Bit-wise operations#

Elementwise bit operations#

bitwise_and

bitwise_or

bitwise_xor

invert

bitwise_invert

left_shift

bitwise_left_shift

right_shift

bitwise_right_shift

bitwise_count

Bit packing#

packbits(a, /[, axis, bitorder])

Packs the elements of a binary-valued array into bits in a uint8 array.

unpackbits(a, /[, axis, count, bitorder])

Unpacks elements of a uint8 array into a binary-valued output array.

Output formatting#

binary_repr(num[, width])

Return the binary representation of the input number as a string.