I have 2 kinds of file contains the data are CSV and XML, I want to code in Python and probably using Pandas to read data from 2 file and compare to check if when one of the file have changed the data but the other wasn't so it print messages to the user. Sum it all, code python for compare mismatch data and print messages to the users
I have tried:
def read_csv(file_path):
...
def read_xml(file_path):
...
def compare_files
mismatches = pd.concat([df_csv_subset, df_xml_subset]).drop_duplicates(keep=False)
# Identify missing data
missing_csv = df_xml_subset.merge(df_csv_subset, how='left', indicator=True).query('_merge == "left_only"').drop('_merge', axis=1)
missing_xml = df_csv_subset.merge(df_xml_subset, how='left', indicator=True).query('_merge == "left_only"').drop('_merge', axis=1)
##orderd the code block
Compare file function is present and its initialization is wrong
I think this should give what you desire