testing stats

This commit is contained in:
Pritimay Sarkar
2024-01-07 23:07:22 +05:30
parent 9cafbf2120
commit a9ff4694f3

25
scripts/testing_stats.py Normal file
View File

@@ -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()