34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
import pandas as pd
|
|
import os
|
|
|
|
curdir = os.getcwd()
|
|
path_delim = '/'
|
|
df1 = pd.read_excel(curdir + path_delim + "data/all_users_14_07_2023_to_12_09_2023.xlsx", sheet_name="Sheet1")
|
|
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_Sept2 copy.xlsx", sheet_name="op")
|
|
|
|
### 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/diff_check.xlsx", engine = 'openpyxl')
|
|
df.to_excel(writer, sheet_name = 'op', index=False)
|
|
writer.close()
|
|
|