From 2aba3a44aa9821577f504e9ab4edd3e3b0f01d46 Mon Sep 17 00:00:00 2001 From: Pritimay Sarkar Date: Wed, 20 Sep 2023 19:04:02 +0530 Subject: [PATCH] find data difference for undeclared --- scripts/combine4.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 scripts/combine4.py diff --git a/scripts/combine4.py b/scripts/combine4.py new file mode 100644 index 0000000..c4906af --- /dev/null +++ b/scripts/combine4.py @@ -0,0 +1,34 @@ +import pandas as pd +import os + +curdir = os.getcwd() +path_delim = '/' +df1 = pd.read_excel(curdir + path_delim + "data/diff_check.xlsx", sheet_name="Sheet3") +# df2 = pd.read_excel(curdir + path_delim + "data/all_users_14_07_2023_to_12_09_2023.xlsx", sheet_name="Sheet2") +# df3 = pd.read_excel(curdir + path_delim + "data/July_Sept3 copy.xlsx", sheet_name="op") + +### merging July +### merging July +df = df1.merge(df2, on="_id", how='outer') +# df = pd.concat([df1, df3], ignore_index=True) +print(df) + +# sample_ids = df["_id"].tolist() +# print(len(sample_ids)) + +print(len(df['_id']) - len(df['_id'].drop_duplicates())) + +# df_dup = df['_id']-df['_id'].drop_duplicates() +# print(df_dedup) + +# dfut = pd.merge(df1, df2, how='outer', +# left_index=True, right_on=['_id', 'Sample ID'], +# indicator=True) + +# print(dfut) +# dfut.query('_merge != "both"') + +writer = pd.ExcelWriter(curdir + path_delim + "data/July_Sept3.xlsx", engine = 'openpyxl') +df.to_excel(writer, sheet_name = 'op', index=False) +writer.close() +