From b05d882cc9c46525a3fe0a9e8aa96093521bd4c9 Mon Sep 17 00:00:00 2001 From: Pritimay Sarkar Date: Thu, 28 Sep 2023 11:10:37 +0530 Subject: [PATCH] remove device type and location, add counts --- scripts/test_collection.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/test_collection.py b/scripts/test_collection.py index 0854762..c32b43a 100644 --- a/scripts/test_collection.py +++ b/scripts/test_collection.py @@ -52,7 +52,10 @@ df = pd.DataFrame(data) print(df) print(df.size) -df = df[["_id", "classificationResult", "calculatedRatio", "deviceId", "deviceRatio", "deviceType", "kitSerial", "led1Average", "led1Buffer", "led1Sample", "led2Average", "led2Buffer", "led2Sample", "location", "deviceSerialNumber", "name", "testTime", "resultData"]] +df = df[["_id", "classificationResult", "calculatedRatio", "deviceId", "deviceRatio", "kitSerial", "led1Average", "led1Buffer", "led1Sample", "led2Average", "led2Buffer", "led2Sample", "deviceSerialNumber", "name", "testTime"]] +# df = df.groupby(["classificationResult"]).describe() +df_count = df.groupby(["classificationResult"]).describe()["calculatedRatio"]["count"] +print(df.groupby(["classificationResult"]).describe()["calculatedRatio"]["count"]) # Save the DataFrame to a CSV file output_filename = f'tests_{datetime.today().strftime("%d_%m_%Y_%H_%M")}.xlsx' @@ -61,6 +64,7 @@ downloads_dir = os.path.join(os.path.expanduser("~"), "Downloads") output_path = os.path.join(downloads_dir, output_filename) writer = pd.ExcelWriter(output_path, engine = 'openpyxl') df.to_excel(writer, sheet_name = 'data', index=False) +df_count.to_excel(writer, sheet_name = "count") writer.close() print(f"Data saved to '{output_path}'")