I am creating a python application where I am trying to compare two Dataframes to identify differences. Given below is the piece of code where I am facing an issue. I am facing an issue in the below line, when it tries to compare between NaN and String/int
different = (a0 != a1)
Error:
TypeError: Cannot change data-type for object array
Code:
df0 = Excel1.parse(sheet)
df1 = Excel2.parse(sheet)
a0, a1 = (df0.fillna('0')).align(df1.fillna('0'))
different = (a0 != a1)
comp = a0[different].join(a1[different], lsuffix='_old', rsuffix='_new')