summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBrigitta Sipocz <bsipocz@gmail.com>2019-10-15 16:41:09 -0700
committerBrigitta Sipocz <bsipocz@gmail.com>2019-10-15 16:41:09 -0700
commitf5da8bb0aa0372ee95df5a823e51b5ac5e08f46d (patch)
tree8e44bb8bb7f41d032ad0a6ec001b338f20c1482c /doc
parent3de7c41034b120f0deb973c6d7971ad57914b003 (diff)
downloadnumpy-f5da8bb0aa0372ee95df5a823e51b5ac5e08f46d.tar.gz
DOC: fix example to close #5406
Diffstat (limited to 'doc')
-rw-r--r--doc/source/reference/maskedarray.generic.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/source/reference/maskedarray.generic.rst b/doc/source/reference/maskedarray.generic.rst
index 7375d60fb..52173530e 100644
--- a/doc/source/reference/maskedarray.generic.rst
+++ b/doc/source/reference/maskedarray.generic.rst
@@ -478,10 +478,10 @@ Numerical operations
Numerical operations can be easily performed without worrying about missing
values, dividing by zero, square roots of negative numbers, etc.::
- >>> import numpy as np, numpy.ma as ma
+ >>> import numpy.ma as ma
>>> x = ma.array([1., -1., 3., 4., 5., 6.], mask=[0,0,0,0,1,0])
>>> y = ma.array([1., 2., 0., 4., 5., 6.], mask=[0,0,0,0,0,1])
- >>> print np.sqrt(x/y)
+ >>> print(ma.sqrt(x/y))
[1.0 -- -- 1.0 -- --]
Four values of the output are invalid: the first one comes from taking the