-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
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
Conversation
jbrockmendel
commented
Dec 19, 2021
- closes API: Index.__getitem__(True) returns 2D ndarray #44051
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
@@ -670,6 +670,21 @@ def test_getitem_2d_deprecated(self, simple_index): | |||
|
|||
assert isinstance(res, np.ndarray), type(res) | |||
|
|||
if not isinstance(idx, RangeIndex): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk
@@ -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`) |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
thanks the first comment pls followup when you have a chance (list of bools when indexing) |