summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
diff options
context:
space:
mode:
authorgfyoung <gfyoung17@gmail.com>2015-12-19 16:49:35 -0800
committergfyoung <gfyoung17@gmail.com>2015-12-19 16:50:09 -0800
commit8bc592fabf4a2b0bc76db996b1523330ba095be3 (patch)
treec8a1a549e5a093a9433fe9a50a6e0e8bb5358ab1 /numpy/ma/extras.py
parente2bdaccba1a8691f9223b059b981b2890bb13b09 (diff)
downloadnumpy-8bc592fabf4a2b0bc76db996b1523330ba095be3.tar.gz
DOC: Use print only as function when print_function is imported from __future__
Closes gh-6863.
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r--numpy/ma/extras.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index e1d228e73..9855b4e76 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -439,7 +439,7 @@ if apply_over_axes.__doc__ is not None:
>>> a = ma.arange(24).reshape(2,3,4)
>>> a[:,0,1] = ma.masked
>>> a[:,1,:] = ma.masked
- >>> print a
+ >>> print(a)
[[[0 -- 2 3]
[-- -- -- --]
[8 9 10 11]]
@@ -447,14 +447,14 @@ if apply_over_axes.__doc__ is not None:
[[12 -- 14 15]
[-- -- -- --]
[20 21 22 23]]]
- >>> print ma.apply_over_axes(ma.sum, a, [0,2])
+ >>> print(ma.apply_over_axes(ma.sum, a, [0,2]))
[[[46]
[--]
[124]]]
Tuple axis arguments to ufuncs are equivalent:
- >>> print ma.sum(a, axis=(0,2)).reshape((1,-1,1))
+ >>> print(ma.sum(a, axis=(0,2)).reshape((1,-1,1)))
[[[46]
[--]
[124]]]
@@ -502,13 +502,13 @@ def average(a, axis=None, weights=None, returned=False):
1.25
>>> x = np.ma.arange(6.).reshape(3, 2)
- >>> print x
+ >>> print(x)
[[ 0. 1.]
[ 2. 3.]
[ 4. 5.]]
>>> avg, sumweights = np.ma.average(x, axis=0, weights=[1, 2, 3],
... returned=True)
- >>> print avg
+ >>> print(avg)
[2.66666666667 3.66666666667]
"""
@@ -1476,7 +1476,7 @@ def flatnotmasked_edges(a):
array([3, 8])
>>> a[:] = np.ma.masked
- >>> print flatnotmasked_edges(ma)
+ >>> print(flatnotmasked_edges(ma))
None
"""
@@ -1578,7 +1578,7 @@ def flatnotmasked_contiguous(a):
>>> np.ma.flatnotmasked_contiguous(a)
[slice(3, 5, None), slice(6, 9, None)]
>>> a[:] = np.ma.masked
- >>> print np.ma.flatnotmasked_edges(a)
+ >>> print(np.ma.flatnotmasked_edges(a))
None
"""