Skip to content

Series.loc[list] with uint64 keys returns a dataframe with Float64Index #28279

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
oguzhanogreden opened this issue Sep 4, 2019 · 1 comment · Fixed by #29420
Closed

Series.loc[list] with uint64 keys returns a dataframe with Float64Index #28279

oguzhanogreden opened this issue Sep 4, 2019 · 1 comment · Fixed by #29420
Labels
Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@oguzhanogreden
Copy link
Contributor

Code Sample, a copy-pastable example if possible

bug = pd.Series([0, 1, 2, 3, 4], index=[7606741985629028552, 17876870360202815256, 13106359306506049338, 8991270399732411471, 8991270399732411472])
assert bug.loc[7606741985629028552]==0
assert bug.loc[17876870360202815256]==1

bug.loc[[7606741985629028552, 17876870360202815256]].index

Problem description

The above selection should not have the side effect of modifying data types. I noticed this while looking at #28023 but I think this is a separate issue, so I'm documenting it separately.

Output of pd.show_versions()

[Same with #28023, I'll update this when I have my laptop at hand.]

@oguzhanogreden
Copy link
Contributor Author

I'll try and tackle this, as well as #28023, in one PR.

@jbrockmendel jbrockmendel added the Indexing Related to indexing on series/frames, not to indexes themselves label Oct 27, 2019
@jreback jreback added this to the 1.0 milestone Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants