This commit is contained in:
Pritimay Sarkar
2023-10-04 23:40:08 +05:30
parent 2bca96a0f6
commit 8544cb3ea0

View File

@@ -1,12 +1,15 @@
import pandas as pd
import os
import numpy as np
import matplotlib.pyplot as plt
curdir = os.getcwd()
path_delim = '/'
df1 = pd.read_excel(curdir + path_delim + "data/users_27_09_2023_19_17.xlsx", sheet_name="Sheet1")
df2 = pd.read_excel(curdir + path_delim + "data/FinalToDeclare27sept.xlsx", sheet_name="DataProcessed")
df2.plot(kind = 'scatter', x = 'testTime', y = 'calculatedRatio')
plt.show()
df = df1.merge(df2, on="_id", how='outer')
print(df.columns)
@@ -22,6 +25,9 @@ df = df.reindex(["Sample ID", "Name", "ABHA ID", "Aadhaar ID", "Age", "Gender",
# df['Date'] = pd.to_datetime(df["Date"].dt.strftime('%d-%m-%Y'))
# df = df.sort_values(by=['Date'], ascending=True)
df["Test Result"].fillna("Retest", inplace = True)
df_final = df
df_final.loc[df_final['Test Result'] == 'Normal', 'Test Result'] = 'Normal (HbA)'
@@ -34,6 +40,6 @@ df_final.loc[df_final['Gender'] == 'Male', 'Gender'] = 'MALE'
df_final.loc[df_final['Gender'] == 'Female', 'Gender'] = 'FEMALE'
print(df_final.groupby(["Test Result"]).describe())
writer = pd.ExcelWriter(curdir + path_delim + "data/Sept27.xlsx", engine = 'openpyxl')
writer = pd.ExcelWriter(curdir + path_delim + "data/Sept27b.xlsx", engine = 'openpyxl')
df_final.to_excel(writer, sheet_name = 'op', index=False)
writer.close()