Skip to main content
`Ctrl`+`K`

# numpy.ma.right_shift

ma.right_shift(a, n)

  Shift the bits of an integer to the right.

  This is the masked array version of `numpy.right_shift`, for details see that function.

  See also

  `numpy.right_shift`

  Examples

      >>> import numpy as np
      >>> 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)