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)
| 7203 | |
| 7204 | |
| 7205 | def 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 | |
| 7226 | def right_shift(a, n): |
no test coverage detected