diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-04-08 14:06:36 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-04-08 14:06:36 -0700 |
commit | 40938e4367b3f6f0f368d71ec3e4722f58592cd8 (patch) | |
tree | 21519059db46e8719d7b7b7d2aab554b52216950 /numpy/lib | |
parent | c8a5f560f1eedd510ca5656b06dd1ca2ba9322bd (diff) | |
download | numpy-40938e4367b3f6f0f368d71ec3e4722f58592cd8.tar.gz |
MAINT: Remove redundant operations in 1d masking
`x1d[nonzero(mask1d)[0]]` is just a less readable way to spell `x1d[mask1d]`
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/histograms.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/histograms.py b/numpy/lib/histograms.py index 66e2ccda1..a770e3d31 100644 --- a/numpy/lib/histograms.py +++ b/numpy/lib/histograms.py @@ -918,7 +918,7 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None): on_edge = (np.around(sample[:, i], decimal) == np.around(edges[i][-1], decimal)) # Shift these points one bin to the left. - Ncount[i][np.nonzero(on_edge & not_smaller_than_edge)[0]] -= 1 + Ncount[i][on_edge & not_smaller_than_edge] -= 1 # Flattened histogram matrix (1D) # Reshape is used so that overlarge arrays |