I was wanting to compare two dfs and ran into this :
df = pd.DataFrame([{'a':1,'b':2},{'a':3,'b':4}])
df2 = pd.DataFrame([{'a':0,'b':2},{'a':3,'b':4}])
The element-by-element comparison works as I would have thought:
df == df2
Out[52]:
a b
0 False True
1 True True
But all(df)
is puzzling me :
all(df==df2)
Out[53]: True
while
(df==df2).all()
Out[54]:
a False
b True
dtype: bool