summaryrefslogtreecommitdiff
path: root/numpy/ma/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r--numpy/ma/core.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 7f57985a9..132761711 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -7202,6 +7202,21 @@ def right_shift(a, n):
--------
numpy.right_shift
+ Examples
+ --------
+ >>> import numpy.ma as ma
+ >>> x = [11, 3, 8, 1]
+ >>> mask = [0, 0, 0, 1]
+ >>> masked_x = ma.masked_array(x, mask)
+ >>> masked_x
+ masked_array(data=[11, 3, 8, --],
+ mask=[False, False, False, True],
+ fill_value=999999)
+ >>> ma.right_shift(masked_x,1)
+ masked_array(data=[5, 1, 4, --],
+ mask=[False, False, False, True],
+ fill_value=999999)
+
"""
m = getmask(a)
if m is nomask: