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
Which is indeed strict and do take order into account.
Expected Output
As I understand the equality of index is about having the same elements. It is not required the elements having the same order. I have the feeling that once pandas worked this way (maybe before v0.23).
What is the intended way ? Maybe the documentation should be a bit more explicit about this comparison. If you indicate me where I can update the doc, I will be glad to edit it.
Output of pd.show_versions()
commit : None
python : 3.6.9.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-91-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8
I think that like the other issue this is really a problem with the documentation and not an actual bug (the method tests for equivalence and not just having the same elements as you point out). I would think that a PR to fix the documentation makes sense?
mroeschke
changed the title
BUG: Index holding exaclty same values are not equals
DOC: Mention Index.equals takes into account order of arguments
Apr 4, 2020
Code Sample, a copy-pastable example
Problem description
I have seen #13708, but according to documentation:
Should it return
True
instead?Reading how the function is implemented:
pandas/pandas/core/indexes/base.py
Lines 4072 to 4074 in 3adf334
It relies on:
pandas/pandas/core/dtypes/missing.py
Lines 421 to 431 in 3adf334
Which is indeed strict and do take order into account.
Expected Output
As I understand the equality of index is about having the same elements. It is not required the elements having the same order. I have the feeling that once pandas worked this way (maybe before
v0.23
).What is the intended way ? Maybe the documentation should be a bit more explicit about this comparison. If you indicate me where I can update the doc, I will be glad to edit it.
Output of
pd.show_versions()
commit : None
python : 3.6.9.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-91-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.0.3
numpy : 1.18.2
pytz : 2019.3
dateutil : 2.8.1
pip : 9.0.1
setuptools : 46.1.3
Cython : 0.29.14
pytest : 5.3.2
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 1.1.8
lxml.etree : 4.3.4
html5lib : 0.999999999
pymysql : None
psycopg2 : 2.8.4 (dt dec pq3 ext lo64)
jinja2 : 2.11.1
IPython : 7.13.0
pandas_datareader: None
bs4 : 4.7.1
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : 4.3.4
matplotlib : 3.2.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.13.0
pytables : None
pytest : 5.3.2
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : 1.3.15
tables : None
tabulate : 0.8.3
xarray : None
xlrd : 1.2.0
xlwt : 1.3.0
xlsxwriter : 1.1.8
numba : None
The text was updated successfully, but these errors were encountered: