-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Make Index.all compatible with numpy.all #40180
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
Make Index.all compatible with numpy.all #40180
Conversation
doc/source/whatsnew/v1.2.4.rst
Outdated
@@ -35,7 +35,7 @@ Bug fixes | |||
Other | |||
~~~~~ | |||
|
|||
- | |||
- Allow :class:`Index` to be passed to the numpy ``all`` function. |
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.
move to 1.3 Bug Fixes in reshaping section, add the PR number as the issue number, can you reference np.all here I think :func:numpy.all
works or similar
@@ -550,6 +550,13 @@ def test_min_max_categorical(self): | |||
assert ci.min() == "c" | |||
assert ci.max() == "b" | |||
|
|||
def test_numpy_any_all(self): | |||
idx = Index([0, 1, 2]) |
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.
can you add the issue number as a comment
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.
can you move this near other tests similar to def test_any_all
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.
can you parameterize over Index & Series
@@ -550,6 +550,13 @@ def test_min_max_categorical(self): | |||
assert ci.min() == "c" | |||
assert ci.max() == "b" | |||
|
|||
def test_numpy_any_all(self): | |||
idx = Index([0, 1, 2]) |
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.
can you parameterize over Index & Series
… and Series compat
21d65ca
to
c102edc
Compare
@jreback Requested changes made - thanks! |
thanks @pauldmccarthy very nice! |
Due to a bug in my own code, I discovered that
pandas.Index
objects cannot be passed to thenumpy.all
function:Using this PR as precedent, the fix is quite straightforward.