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):
120
120
return d
121
121
122
122
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
+
123
130
def get_values (values ):
124
131
# Create data view without diff column.
125
132
if "diff" in values .columns :
@@ -417,11 +424,11 @@ def main():
417
424
lhs = files [0 :split ]
418
425
rhs = files [split + 1 :]
419
426
420
- # Filter minimum of lhs and rhs
427
+ # Combine the multiple left and right hand sides.
421
428
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 )
423
430
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 )
425
432
426
433
# Combine to new dataframe
427
434
data = pd .concat (
You can’t perform that action at this time.
0 commit comments