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

DEPR: indexing Series with single-entry list #31333

Merged
merged 6 commits into from
Feb 9, 2020

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Jan 27, 2020

Could use a better warning message, suggestions welcome.

@jbrockmendel jbrockmendel added Deprecate Functionality to remove in pandas Indexing Related to indexing on series/frames, not to indexes themselves labels Jan 29, 2020
Copy link
Contributor

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

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

This seems reasonable. Will users see this warning in addition to the warnings in #31299 (comment)?

Will need a whatsnew note.

# GH#31299
warnings.warn(
"Indexing with a single-item list containing a "
"slice is deprecated and will raise in a future "
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know what it will raise? Or will it depend on the value?

Copy link
Member Author

Choose a reason for hiding this comment

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

Best guess is TypeError, depends on where we let it fall through

@jbrockmendel
Copy link
Member Author

Will users see this warning in addition to the warnings in #31299 (comment)?

No, this will change the list to tuple before calling ndarray.__getitem__

Will need a whatsnew note.

updated

@jreback jreback added this to the 1.1 milestone Feb 9, 2020
@jreback jreback merged commit 04e9a78 into pandas-dev:master Feb 9, 2020
@jreback
Copy link
Contributor

jreback commented Feb 9, 2020

thanks, can you add to the deprecation issue (do this for anything we are deprecating).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPR: disallow series[[slice(...)]]
3 participants