Skip to content

Commit 0966478

Browse files
committed
Make sure None is treated as non-zero
For some reason `argwhere` treats None as zero which fails an existing test.
1 parent 44aa4cd commit 0966478

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numpy/lib/_function_base_impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ def _arg_trim_zeros(filt):
18911891
>>> _arg_trim_zeros(np.array([0, 0, 1, 1, 0]))
18921892
(array([2]), array([3]))
18931893
"""
1894-
nonzero = np.argwhere(filt)
1894+
nonzero = np.argwhere(filt != 0)
18951895
if nonzero.size == 0:
18961896
start = stop = np.array([], dtype=np.intp)
18971897
else:

0 commit comments

Comments
 (0)