@@ -7401,10 +7401,12 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
7401
7401
** kwargs ):
7402
7402
"""
7403
7403
call signature::
7404
-
7405
- hist(x, bins=10, range=None, normed=False, cumulative=False,
7406
- bottom=None, histtype='bar', align='mid',
7407
- orientation='vertical', rwidth=None, log=False, **kwargs)
7404
+
7405
+ def hist(x, bins=10, range=None, normed=False, weights=None,
7406
+ cumulative=False, bottom=None, histtype='bar', align='mid',
7407
+ orientation='vertical', rwidth=None, log=False,
7408
+ color=None, label=None,
7409
+ **kwargs):
7408
7410
7409
7411
Compute and draw the histogram of *x*. The return value is a
7410
7412
tuple (*n*, *bins*, *patches*) or ([*n0*, *n1*, ...], *bins*,
@@ -7567,7 +7569,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
7567
7569
'this looks transposed (shape is %d x %d)' % x .shape [::- 1 ])
7568
7570
else :
7569
7571
# multiple hist with data of different length
7570
- x = [np .array (xi ) for xi in x ]
7572
+ x = [np .asarray (xi ) for xi in x ]
7571
7573
7572
7574
nx = len (x ) # number of datasets
7573
7575
@@ -7582,15 +7584,15 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
7582
7584
# We need to do to 'weights' what was done to 'x'
7583
7585
if weights is not None :
7584
7586
if isinstance (weights , np .ndarray ) or not iterable (weights [0 ]) :
7585
- w = np .array (weights )
7587
+ w = np .asarray (weights )
7586
7588
if w .ndim == 2 :
7587
7589
w = w .T
7588
7590
elif w .ndim == 1 :
7589
7591
w .shape = (1 , w .shape [0 ])
7590
7592
else :
7591
7593
raise ValueError ("weights must be 1D or 2D" )
7592
7594
else :
7593
- w = [np .array (wi ) for wi in weights ]
7595
+ w = [np .asarray (wi ) for wi in weights ]
7594
7596
7595
7597
if len (w ) != nx :
7596
7598
raise ValueError ('weights should have the same shape as x' )
0 commit comments