Skip to content

Commit

Permalink
DOC: any: expand example
Browse files Browse the repository at this point in the history
Expand example to demonstrate a) convention of `np.any` with infinite values and b) the use of `keepdims`
  • Loading branch information
bhavyaalekhya committed Dec 29, 2023
1 parent dde213e commit ee3124b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions numpy/_core/fromnumeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -2441,8 +2441,9 @@ def any(a, axis=None, out=None, keepdims=np._NoValue, *, where=np._NoValue):
>>> np.any([-1, 0, 5])
True
>>> np.any(np.nan)
True
>>> np.any([[np.nan], [np.inf]], axis=1, keepdims=True)
array([[ True],
[ True]])
>>> np.any([[True, False], [False, False]], where=[[False], [True]])
False
Expand Down

0 comments on commit ee3124b

Please sign in to comment.