Skip to content
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

CLN: Changed the behavior of Series.__[gs]etitem__ with an integer slice on objects with a floating-dtype index to a positional instead of label-based slicing #58449

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

natmokval
Copy link
Contributor

@natmokval natmokval commented Apr 26, 2024

xref #53338
Changed the behavior of Series.__getitem__, Series.__setitem__, DataFrame.__getitem__, DataFrame.__setitem__ with an integer slice on objects with a floating-dtype index to a positional instead of label-based slicing

"use obj.loc[i:j] instead",
FutureWarning,
stacklevel=find_stack_level(),
raise TypeError(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s not unsupported. The point is to change the behavior to not special-case here

Copy link
Contributor Author

@natmokval natmokval Apr 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for helping me with this PR. I corrected my mistake, fixed tests, and added a note to v3.0.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbrockmendel could you please take a look at my changes?

@natmokval natmokval changed the title CLN: Enforce the deprecation of using obj[i:j] with a float-dtype index CLN: Changed the behavior of Series.__[gs]etitem__ Enforce with an integer slice on objects with a floating-dtype index to a positional instead of label-based slicing Apr 26, 2024
@natmokval natmokval changed the title CLN: Changed the behavior of Series.__[gs]etitem__ Enforce with an integer slice on objects with a floating-dtype index to a positional instead of label-based slicing CLN: Changed the behavior of Series.__[gs]etitem__ with an integer slice on objects with a floating-dtype index to a positional instead of label-based slicing Apr 26, 2024
@natmokval natmokval added Clean Indexing Related to indexing on series/frames, not to indexes themselves labels Apr 26, 2024
@natmokval natmokval marked this pull request as ready for review April 27, 2024 13:08
@natmokval natmokval marked this pull request as draft May 4, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants