File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -4295,15 +4295,15 @@ def reduce(
42954295 or np .issubdtype (var .dtype , np .number )
42964296 or (var .dtype == np .bool_ )
42974297 ):
4298- if len (reduce_dims ) == 1 :
4299- # unpack dimensions for the benefit of functions
4300- # like np.argmin which can't handle tuple arguments
4301- (reduce_dims ,) = reduce_dims
4302- elif len (reduce_dims ) == var .ndim :
4298+ if len (reduce_dims ) == var .ndim :
43034299 # prefer to aggregate over axis=None rather than
43044300 # axis=(0, 1) if they will be equivalent, because
43054301 # the former is often more efficient
43064302 reduce_dims = None # type: ignore
4303+ elif len (reduce_dims ) == 1 :
4304+ # unpack dimensions for the benefit of functions
4305+ # like np.argmin which can't handle tuple arguments
4306+ (reduce_dims ,) = reduce_dims
43074307 variables [name ] = var .reduce (
43084308 func ,
43094309 dim = reduce_dims ,
You can’t perform that action at this time.
0 commit comments