35 lines
1.7 KiB
Python
35 lines
1.7 KiB
Python
import pandas as pd
|
|
import os
|
|
|
|
curdir = os.getcwd()
|
|
path_delim = '/'
|
|
df = pd.read_csv(curdir + path_delim + 'data/bquxjob_6ab822ae_18c5f7cb3c7.csv')
|
|
df = df.dropna()
|
|
print(df)
|
|
|
|
print(df["finalResult"].unique())
|
|
|
|
df['testResult'] = df['finalResult']
|
|
df.loc[df['testResult'] == 'Normal', 'testResult'] = 'Normal'
|
|
df.loc[df['testResult'] == 'Normal (HbA)', 'testResult'] = 'Normal'
|
|
df.loc[df['testResult'] == 'Sickle Cell Trait', 'testResult'] = 'SCT'
|
|
df.loc[df['testResult'] == 'Sickle Cell Trait (HbAS)', 'testResult'] = 'SCT'
|
|
df.loc[df['testResult'] == 'Sickle cell Trait (HbAS)', 'testResult'] = 'SCT'
|
|
df.loc[df['testResult'] == 'Sickle Cell Disease', 'testResult'] = 'SCD'
|
|
df.loc[df['testResult'] == 'Sickle Cell Disease (HbAS)', 'testResult'] = 'SCD'
|
|
df.loc[df['testResult'] == 'Sickle cell Disease (HbSS)', 'testResult'] = 'SCD'
|
|
df.loc[df['testResult'] == 'Positive for Sickle Cell. HPLC for Confirmation', 'testResult'] = 'Inconclusive'
|
|
df.loc[df['testResult'] == 'Inconclusive. Very low Absorbance - Repeat test with Higher Blood Volume', 'testResult'] = 'Inconclusive'
|
|
df.loc[df['testResult'] == 'Negative Borderline. Repeat Test', 'testResult'] = 'Inconclusive'
|
|
df.loc[df['testResult'] == 'Inconclusive. Very low Absorbance - Repeat test with Higher Blood Volume', 'testResult'] = 'Inconclusive'
|
|
df.loc[df['testResult'] == 'Inconclusive. Repeat with test with lower volume of blood', 'testResult'] = 'Inconclusive'
|
|
|
|
df = df.drop_duplicates()
|
|
|
|
print(df.groupby(["testResult"]).describe())
|
|
|
|
# writer = pd.ExcelWriter(curdir + path_delim + "data/dataset4.xlsx", engine = 'openpyxl')
|
|
# df.to_excel(writer, sheet_name = 'op', index=False)
|
|
df.to_csv(curdir + path_delim + "data/dataset04.csv", index=False)
|
|
# df_count.to_excel(writer, sheet_name = "count")
|
|
# writer.close() |