MCPcopy Create free account
hub / github.com/numpy/numpy / left_shift

Function left_shift

numpy/ma/core.py:7205–7223  ·  view source on GitHub ↗

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 -------- numpy.left_shift

(a, n)

Source from the content-addressed store, hash-verified

7203
7204
7205def left_shift(a, n):
7206 """
7207 Shift the bits of an integer to the left.
7208
7209 This is the masked array version of `numpy.left_shift`, for details
7210 see that function.
7211
7212 See Also
7213 --------
7214 numpy.left_shift
7215
7216 """
7217 m = getmask(a)
7218 if m is nomask:
7219 d = umath.left_shift(filled(a), n)
7220 return masked_array(d)
7221 else:
7222 d = umath.left_shift(filled(a, 0), n)
7223 return masked_array(d, mask=m)
7224
7225
7226def right_shift(a, n):

Callers 3

__lshift__Method · 0.90
__rlshift__Method · 0.90
__ilshift__Method · 0.90

Calls 2

getmaskFunction · 0.85
filledFunction · 0.85

Tested by

no test coverage detected