-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: index name lost when indexing with another index #9943
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
Comments
There are 2 things going on here:
|
I agree, indexing should never change index names. |
@jreback When this was opened, you wrote:
I'd like to confirm that the behavior for If that is the case, then the behavior reported initially is what is expected, because the intersection is being taken between an |
Following up on my question to @jreback above about the behaviors, I think the behavior of
And then you compute In fact, pandas 0.22.0 has a bug in the following case (which only occurs when one of the indexes in the union operation is empty, or if taking the union or intersection of 2 indexes that are the same, but have different names):
In this case, I hope to have straightened this out when I get things right in the pull request #19849. |
we have very specific matching behavior for Index operations meaning that if they match you get the name back; if they are different you get None (this includes the case of one has None one has a value) so not sure this should be any different |
It appears that #19849 was supposed to close this issue, but if that's not the case happy to reopen. |
Very subtle. Index name stays when using .ix [ list ], but gets lost when using .ix[ Int64Index ].
The text was updated successfully, but these errors were encountered: