位运算#

逐元素位运算#

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])

返回输入数字的二进制表示形式,类型为字符串.