diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-03-08 11:07:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-08 11:07:06 +0000 |
commit | 485b099cd4b82d65dc38cb2b28c7119f003c76c4 (patch) | |
tree | 809cbc5926d6c38aa87e42f980a4e9b5568901c0 /numpy/lib/function_base.py | |
parent | 6a3edf3210b439a4d1a51acb4e01bac017697ee6 (diff) | |
parent | 1588ae39ffb51ea916f03510671aab711fdfb568 (diff) | |
download | numpy-485b099cd4b82d65dc38cb2b28c7119f003c76c4.tar.gz |
Merge pull request #8750 from warut-vijit/master
BUG: Fix np.average for object arrays
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index c54512c21..0903790bd 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -1135,7 +1135,7 @@ def average(a, axis=None, weights=None, returned=False): wgt = wgt.swapaxes(-1, axis) scl = wgt.sum(axis=axis, dtype=result_dtype) - if (scl == 0.0).any(): + if np.any(scl == 0.0): raise ZeroDivisionError( "Weights sum to zero, can't be normalized") |