From a9ff4694f35fcc182d63b0273ccf420dbfd29c53 Mon Sep 17 00:00:00 2001 From: Pritimay Sarkar Date: Sun, 7 Jan 2024 23:07:22 +0530 Subject: [PATCH] testing stats --- scripts/testing_stats.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/testing_stats.py diff --git a/scripts/testing_stats.py b/scripts/testing_stats.py new file mode 100644 index 0000000..f1675f0 --- /dev/null +++ b/scripts/testing_stats.py @@ -0,0 +1,25 @@ +import pandas as pd +import os +import numpy as np +import matplotlib.pyplot as plt + +curdir = os.getcwd() +path_delim = '/' +df = pd.read_excel(curdir + path_delim + "data/tests_03_01_2024_14_41.xlsx", sheet_name="data") + +print(df.columns) +df['deviceId'].hist() +# plt.show() + +print(df) + +df_final = df.sort_values('testTime').drop_duplicates('_id', keep='last') +print(df_final) + +print(df_final.groupby(["classificationResult"]).describe()["calculatedRatio"]["count"]) + +writer = pd.ExcelWriter(curdir + path_delim + "data/test_stats03.xlsx", engine = 'openpyxl') +df_final.to_excel(writer, sheet_name = 'op', index=False) +df_final.groupby(["classificationResult"]).describe()["calculatedRatio"]["count"].to_excel(writer, sheet_name = "hc_count") +df_final.groupby(["result"]).describe()["resultRatio"]["count"].to_excel(writer, sheet_name = "tr_count") +writer.close() \ No newline at end of file