I Have to compare the data between tables of two different databases using dataframes in python scripting.
Say I have a table in database A and I am creating a csv file contains results of table. and I have table in database B and I am creating a csv file contains results of this table.
Now I have 2 CSV files and reading them using pandas, putting into different frames.
I am able to do simple comparison between two dataframes but unable to do comparison properly like for different datatypes or different labeled objects. Can someone help me with in doing proper comparison between dataframes which checks blank values, datatypes, values etc...and generates an output with the differences?
import pandas as pd
dataframe1 = pd.read_csv('a.csv')
print(dataframe1)
dataframe2 = pd.read_csv('b.csv')
print(dataframe2)
#printing difference between two dataframes
print(dataframe1 !=dataframe2)
Actual: above code is giving me differences in console but not a proper comparison. It is giving me like shown in attached image. It is giving me false and true for those values which are not matching but not providing what values are different?Actual output in console
Expected: I need output in HTML or CSV file with values which are different with false status