Skip to content

Commit

Permalink
#937 Removing all non-Averages rows
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelgitgomes committed Apr 30, 2024
1 parent 9214691 commit f147c0e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions atom_batch_execution/scripts/process_results
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ def averageCsvFiles(filenames):
for filename_idx, filename in enumerate(filenames):
df = pd.read_csv(filename)

# Filter all cells for averages
df = df[df['Collection #'].isin(['Averages'])]

df = df.apply(pd.to_numeric, errors="coerce")
pandas_dfs.append(df)

# Concatenate and average all numeric cells
g = pd.concat(pandas_dfs).groupby(level=0).mean()
g = pd.concat(pandas_dfs).mean()

# replace the text cells with
g.fillna(pandas_text_df, inplace=True)
g.fillna('Averages', inplace=True)

return g

Expand Down

0 comments on commit f147c0e

Please sign in to comment.