位运算#

按元素位运算#

bitwise_and (x1, x2, /[, out, where, ...])

计算两个数组的按元素位与.

bitwise_or (x1, x2, /[, out, where, casting, ...])

计算两个数组按元素的位或.

bitwise_xor (x1, x2, /[, out, where, ...])

计算两个数组按元素的位异或.

invert (x, /[, out, where, casting, order, ...])

按元素计算位反转,或按位非.

bitwise_invert (x, /[, out, where, casting, ...])

按元素计算位反转,或按位非.

left_shift (x1, x2, /[, out, where, casting, ...])

将整数的位向左移动.

bitwise_left_shift (x1, x2, /[, out, where, ...])

将整数的位向左移动.

right_shift (x1, x2, /[, out, where, ...])

将整数的位向右移动.

bitwise_right_shift (x1, x2, /[, out, where, ...])

将整数的位向右移动.

bitwise_count (x, /[, out, where, casting, ...])

计算 x 绝对值中 1 的位数.

位打包#

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

将二进制值数组的元素打包到 uint8 数组中的位中.

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

将 uint8 数组的元素解包到二进制值的输出数组中.

输出格式#

binary_repr (num[, width])

返回作为字符串的输入数字的二进制表示.