summaryrefslogtreecommitdiff
path: root/numpy/ma
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2012-11-23 10:14:39 -0700
committerCharles Harris <charlesr.harris@gmail.com>2012-11-23 10:35:03 -0700
commit65ed5ebfeac3fb6ff8896bf624e1e08113901b76 (patch)
treef6266437da0d748f07db2fc70a2d212eaff6251e /numpy/ma
parent7678c988f88305bfb9be516700e8e05d902f1631 (diff)
downloadnumpy-65ed5ebfeac3fb6ff8896bf624e1e08113901b76.tar.gz
MAINT: Avoid unneeded call in masked array std method.
The square root of the variance was taken twice when the out parameter was specified.
Diffstat (limited to 'numpy/ma')
-rw-r--r--numpy/ma/core.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index b3549654d..dd2fc2adc 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -4774,10 +4774,10 @@ class MaskedArray(ndarray):
""
dvar = self.var(axis=axis, dtype=dtype, out=out, ddof=ddof)
if dvar is not masked:
- dvar = sqrt(dvar)
if out is not None:
np.power(out, 0.5, out=out, casting='unsafe')
return out
+ dvar = sqrt(dvar)
return dvar
std.__doc__ = np.std.__doc__