Skip to content

Commit

Permalink
Merge pull request #446 from phac-nml/empty_summaries
Browse files Browse the repository at this point in the history
skip empty dataframes to avoid runtime error
  • Loading branch information
arnauqb authored Sep 15, 2022
2 parents 340ebd4 + c3f904d commit 33c20a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions june/records/records_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ def combine_summaries(record_path, remove_left_overs=False, save_dir=None):
dfs = []
for summary_file in summary_files:
df = pd.read_csv(summary_file)

#skip summary_file if df contains no rows
if len(df.index) == 0:
continue

aggregator = {
col: np.mean if "current" in col else sum for col in df.columns[2:]
}
Expand Down

0 comments on commit 33c20a4

Please sign in to comment.