summaryrefslogtreecommitdiff
path: root/numpy/lib/histograms.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-04-08 14:30:21 -0700
committerEric Wieser <wieser.eric@gmail.com>2018-04-08 15:01:27 -0700
commitf4df81f8dcd5c7361a273b7c6cf294a9e8c0841c (patch)
tree5cea10c30c415d40d70736f562c825adce25377b /numpy/lib/histograms.py
parentdbaca82d6d8c63f4d48ec08ae07e45e5b7bc2000 (diff)
downloadnumpy-f4df81f8dcd5c7361a273b7c6cf294a9e8c0841c.tar.gz
MAINT: Don't use a dict with numeric keys when a tuple would do fine
Diffstat (limited to 'numpy/lib/histograms.py')
-rw-r--r--numpy/lib/histograms.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/lib/histograms.py b/numpy/lib/histograms.py
index 49f741dd4..f402a02c1 100644
--- a/numpy/lib/histograms.py
+++ b/numpy/lib/histograms.py
@@ -899,9 +899,10 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
return np.zeros(nbin-2), edges
# Compute the bin number each sample falls into.
- Ncount = {}
- for i in np.arange(D):
- Ncount[i] = np.digitize(sample[:, i], edges[i])
+ Ncount = tuple(
+ np.digitize(sample[:, i], edges[i])
+ for i in np.arange(D)
+ )
# Using digitize, values that fall on an edge are put in the right bin.
# For the rightmost bin, we want values equal to the right edge to be