diff options
author | Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> | 2022-01-28 15:04:19 +0530 |
---|---|---|
committer | Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> | 2022-01-28 15:04:19 +0530 |
commit | 17bc2fb722735fb01d416740c422bce1793d7550 (patch) | |
tree | 61e3322f2560692853fefbc9b4435c44d86fa334 | |
parent | da7f61cb24885ad50cf3a31fcb60139c0f0ba876 (diff) |
merge-metric-csvs.py: Fix order of symbols in output csv.
Change-Id: I1430b5a7d0c63d043a643a9243073f4d27b9ffa5
-rwxr-xr-x | merge-metric-csvs.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/merge-metric-csvs.py b/merge-metric-csvs.py index 032cdc4..27e7c04 100755 --- a/merge-metric-csvs.py +++ b/merge-metric-csvs.py @@ -37,8 +37,14 @@ def main(): for metric in default_metric_values.keys(): result[metric] = result[metric].fillna(default_metric_values[metric], downcast="infer") - # Sort according to benchmark, so that we get all the entries for same benchmark contiguously. - result = result.sort_values("benchmark") + # Sort in ascending order w.r.t benchmark, and then sort in + # descending order w.r.t sample. + # So, the output is: + # (1) All symbols belonging to same benchmark are ordered contiguously. + # (2) All symbols within the same benchmark are ordered in descending order + # w.r.t samples. + + result = result.sort_values(["benchmark", "sample"], ascending=[True, False]) result.to_csv(sys.stdout, index=False) if __name__ == "__main__": |