diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-10-05 09:03:37 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-10-05 09:03:37 -0700 |
commit | 0cfa4ed4ee39aaa94e4059c6394a4ed75a8e3d6c (patch) | |
tree | ec3cf1089baae1b9b0838957d4e44769b3583109 /numpy/core/_methods.py | |
parent | c2dc2cdb73530805b77a75efdd106d7633f2fff3 (diff) | |
parent | 2f77e1e6e6b91a9cd11c422342c69e8fd68ee803 (diff) | |
download | numpy-0cfa4ed4ee39aaa94e4059c6394a4ed75a8e3d6c.tar.gz |
Merge pull request #3866 from charris/refactor-1.9-nanfunctions
Refactor 1.9 nanfunctions
Diffstat (limited to 'numpy/core/_methods.py')
-rw-r--r-- | numpy/core/_methods.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/core/_methods.py b/numpy/core/_methods.py index 8f0027616..c8a968c97 100644 --- a/numpy/core/_methods.py +++ b/numpy/core/_methods.py @@ -91,8 +91,9 @@ def _var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False): arrmean = arrmean.dtype.type(arrmean / rcount) # Compute sum of squared deviations from mean - # Note that x may not be inexact - x = arr - arrmean + # Note that x may not be inexact and that we need it to be an array, + # not a scalar. + x = asanyarray(arr - arrmean) if issubclass(arr.dtype.type, nt.complexfloating): x = um.multiply(x, um.conjugate(x), out=x).real else: |