Skip to content

DEPR: Index.__getitem__[bool] GH#44051 #44973

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

Merged
merged 1 commit into from
Dec 19, 2021
Merged

Conversation

jbrockmendel
Copy link
Member

@@ -670,6 +670,21 @@ def test_getitem_2d_deprecated(self, simple_index):

assert isinstance(res, np.ndarray), type(res)

if not isinstance(idx, RangeIndex):
Copy link
Contributor

Choose a reason for hiding this comment

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

what about a list of bools?

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure, but definitely out of scope

Copy link
Contributor

Choose a reason for hiding this comment

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

kk

@jreback jreback added Deprecate Functionality to remove in pandas Indexing Related to indexing on series/frames, not to indexes themselves labels Dec 19, 2021
@jreback jreback added this to the 1.4 milestone Dec 19, 2021
@@ -540,6 +540,7 @@ Other Deprecations
- Deprecated parameter ``names`` in :meth:`Index.copy` (:issue:`44916`)
- A deprecation warning is now shown for :meth:`DataFrame.to_latex` indicating the arguments signature may change and emulate more the arguments to :meth:`.Styler.to_latex` in future versions (:issue:`44411`)
- Deprecated :meth:`Categorical.replace`, use :meth:`Series.replace` instead (:issue:`44929`)
- Deprecated :meth:`Index.__getitem__` with a bool key; use ``index.values[key]`` to get the old behavior (:issue:`44051`)
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 have other deprecated indexing like this? can you co-locate (followup ok too)

Copy link
Member Author

Choose a reason for hiding this comment

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

i think from a previous version, so the note will be in a different file

Copy link
Contributor

Choose a reason for hiding this comment

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

kk that's fine then

@jreback jreback merged commit 9e1a741 into pandas-dev:master Dec 19, 2021
@jreback
Copy link
Contributor

jreback commented Dec 19, 2021

thanks the first comment pls followup when you have a chance (list of bools when indexing)

@jbrockmendel jbrockmendel deleted the bugs branch December 19, 2021 23:09
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.

API: Index.__getitem__(True) returns 2D ndarray
2 participants