I tried all the solutions here: Pandas "Can only compare identically-labeled DataFrame objects" error
Didn\'t work for me. Here\'s what I\'ve got. I hav
In order to get around this, you want to compare the underlying numpy arrays.
import pandas as pd
df1 = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B'], index=['One', 'Two'])
df2 = pd.DataFrame([[1, 2], [3, 4]], columns=['a', 'b'], index=['one', 'two'])
df1.values == df2.values
array([[ True, True],
[ True, True]], dtype=bool)