Shift the bits of an integer to the left.
This is the masked array version of numpy.left_shift, for details see that function.
See also
Shift with a masked array:
>>> arr = np.ma.array([10, 20, 30], mask=[False, True, False])
>>> np.ma.left_shift(arr, 1)
masked_array(data=[20, --, 60],
mask=[False, True, False],
fill_value=999999)
Large shift:
>>> np.ma.left_shift(10, 10)
masked_array(data=10240,
mask=False,
fill_value=999999)
Shift with a scalar and an array:
>>> scalar = 10
>>> arr = np.ma.array([1, 2, 3], mask=[False, True, False])
>>> np.ma.left_shift(scalar, arr)
masked_array(data=[20, --, 80],
mask=[False, True, False],
fill_value=999999)
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.ma.left_shift.html