File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -6122,22 +6122,21 @@ def _normalize_input(inp, ename='input'):
6122
6122
binsgiven = (cbook .iterable (bins ) or bin_range is not None )
6123
6123
6124
6124
# basic input validation
6125
- flat = np .ravel (x )
6125
+ input_empty = len ( np .ravel (x )) == 0
6126
6126
6127
- input_empty = len (flat ) == 0
6128
-
6129
- # Massage 'x' for processing.
6127
+ # Massage shape of 'x' to be a list of arrays
6130
6128
if input_empty :
6131
- x = np .array ([[]])
6129
+ x = [ np .array ([[]])]
6132
6130
else :
6133
6131
x = _normalize_input (x , 'x' )
6134
6132
nx = len (x ) # number of datasets
6135
6133
6136
- # We need to do to 'weights' what was done to 'x'
6137
- if weights is not None :
6138
- w = _normalize_input (weights , 'weights' )
6139
- else :
6134
+ # Massage shape of 'weights' to be a list, where each element
6135
+ # weights[i] is either None or an array with the same shape as x[i]
6136
+ if weights is None :
6140
6137
w = [None ]* nx
6138
+ else :
6139
+ w = _normalize_input (weights , 'weights' )
6141
6140
6142
6141
if len (w ) != nx :
6143
6142
raise ValueError ('weights should have the same shape as x' )
You can’t perform that action at this time.
0 commit comments