File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,13 @@ def readmulti(filenames):
120120 return d
121121
122122
123+ def merge_values (values , merge_function ):
124+ # Drop the "hash" column because it's irreducible for averages.
125+ if merge_function is pd .DataFrame .mean and "hash" in values .columns :
126+ values = values [[c for c in values .columns if c != "hash" ]]
127+ return values .groupby (level = 1 ).apply (merge_function )
128+
129+
123130def get_values (values ):
124131 # Create data view without diff column.
125132 if "diff" in values .columns :
@@ -417,11 +424,11 @@ def main():
417424 lhs = files [0 :split ]
418425 rhs = files [split + 1 :]
419426
420- # Filter minimum of lhs and rhs
427+ # Combine the multiple left and right hand sides.
421428 lhs_d = readmulti (lhs )
422- lhs_merged = lhs_d . groupby ( level = 1 ). apply ( config .merge_function )
429+ lhs_merged = merge_values ( lhs_d , config .merge_function )
423430 rhs_d = readmulti (rhs )
424- rhs_merged = rhs_d . groupby ( level = 1 ). apply ( config .merge_function )
431+ rhs_merged = merge_values ( rhs_d , config .merge_function )
425432
426433 # Combine to new dataframe
427434 data = pd .concat (
You can’t perform that action at this time.
0 commit comments