summaryrefslogtreecommitdiff
path: root/numpy/lib/twodim_base.py
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@google.com>2019-06-11 21:13:12 -0400
committerStephan Hoyer <shoyer@google.com>2019-06-11 21:13:18 -0400
commit080bf0064b64c3c95499473101c297c3d10e5348 (patch)
treeeeb1e1215708c7bf66b9ec540b59261c4ed4a1f8 /numpy/lib/twodim_base.py
parentbc3c7176987a5017126abbc861458fe53cd099fc (diff)
downloadnumpy-080bf0064b64c3c95499473101c297c3d10e5348.tar.gz
MAINT: fix histogram*d dispatchers
fixes GH-13728
Diffstat (limited to 'numpy/lib/twodim_base.py')
-rw-r--r--numpy/lib/twodim_base.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py
index e165c9b02..1928aa10c 100644
--- a/numpy/lib/twodim_base.py
+++ b/numpy/lib/twodim_base.py
@@ -565,7 +565,13 @@ def vander(x, N=None, increasing=False):
def _histogram2d_dispatcher(x, y, bins=None, range=None, normed=None,
weights=None, density=None):
- return (x, y, bins, weights)
+ yield x
+ yield y
+ if hasattr(bins, 'shape'): # same condition as used in histogramdd
+ yield bins
+ else:
+ yield from bins
+ return weights
@array_function_dispatch(_histogram2d_dispatcher)