You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe .equals() is incorrectly returning False on dataframes that are identical except for ordering of indexes. Think this may relate to closed issues #9330 and #9745.
Example
In [1]: importpandasaspdIn [2]: df1=pd.DataFrame({'a':[1,2,3]}, index=['x','y','z'])
In [3]: df2=pd.DataFrame({'a':[1,3,2]}, index=['x','z','y'])
In [4]: df1.equals(df2)
Out[4]: False#expected TrueIn [5]: df1.equals(df2.sort_index())
Out[5]: True
Thanks @jreback. The docs for .equals() only refer to testing if two NDFrame objects contain the same elements (and don't mention index ordering). Would a pull request expanding on the doc string for this be likely to be accepted?
Hi,
I believe
.equals()
is incorrectly returningFalse
on dataframes that are identical except for ordering of indexes. Think this may relate to closed issues #9330 and #9745.Example
output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: