Skip to content

BUG/API: Index.equals should check input class? #13107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sinhrks opened this issue May 6, 2016 · 3 comments
Closed

BUG/API: Index.equals should check input class? #13107

sinhrks opened this issue May 6, 2016 · 3 comments
Labels
Milestone

Comments

@sinhrks
Copy link
Member

sinhrks commented May 6, 2016

Code Sample, a copy-pastable example if possible

Decide the behavior if non Index with same values is passed. Currently, there is incompatibility between dtypes.

pd.Index([1], dtype=object).equals(pd.Series([1], dtype=object))
# False

pd.Index([1]).equals(pd.Series([1]))
# True

output of pd.show_versions()

on current master

@sinhrks sinhrks added the Bug label May 6, 2016
@sinhrks sinhrks added this to the 0.18.2 milestone May 6, 2016
@jreback
Copy link
Contributor

jreback commented May 6, 2016

these have to be dtype compat as well as values

right so the top should work

@sinhrks
Copy link
Member Author

sinhrks commented May 7, 2016

@jreback OK, always return False if input is not Index. Regarding dtype, there are some tests which allows the difference.

You mean following must be False?

pd.Index([1, 2]).equals(pd.Index([1., 2.]))
# True

@jreback
Copy link
Contributor

jreback commented May 7, 2016

no what I mean is another Index is ok, but NOT a Series.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants