add plot
This commit is contained in:
@@ -1,12 +1,15 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
import os
|
import os
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
curdir = os.getcwd()
|
curdir = os.getcwd()
|
||||||
path_delim = '/'
|
path_delim = '/'
|
||||||
df1 = pd.read_excel(curdir + path_delim + "data/users_27_09_2023_19_17.xlsx", sheet_name="Sheet1")
|
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 = 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')
|
df = df1.merge(df2, on="_id", how='outer')
|
||||||
print(df.columns)
|
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['Date'] = pd.to_datetime(df["Date"].dt.strftime('%d-%m-%Y'))
|
||||||
|
|
||||||
# df = df.sort_values(by=['Date'], ascending=True)
|
# df = df.sort_values(by=['Date'], ascending=True)
|
||||||
|
|
||||||
|
df["Test Result"].fillna("Retest", inplace = True)
|
||||||
|
|
||||||
df_final = df
|
df_final = df
|
||||||
|
|
||||||
df_final.loc[df_final['Test Result'] == 'Normal', 'Test Result'] = 'Normal (HbA)'
|
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'
|
df_final.loc[df_final['Gender'] == 'Female', 'Gender'] = 'FEMALE'
|
||||||
print(df_final.groupby(["Test Result"]).describe())
|
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)
|
df_final.to_excel(writer, sheet_name = 'op', index=False)
|
||||||
writer.close()
|
writer.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user