二進制操作
單元位運算
- bitwise_and(x1, x2, /[, out, where, …]) 計算位和兩個數(shù)組的元素。
- bitwise_or(x1, x2, /[, out, where, casting, …]) 計算兩個數(shù)組元素的位或悦屏。
- bitwise_xor(x1, x2, /[, out, where, …]) 計算兩個數(shù)組元素的位異或幌缝。
- invert(x, /[, out, where, casting, order, …]) 按位計算求逆娜扇,或按位求逆,按元素計算趾唱。
- left_shift(x1, x2, /[, out, where, casting, …]) 將整數(shù)的位向左移死讹。
- right_shift(x1, x2, /[, out, where, …]) 將整數(shù)的位向右移悉默。
Bit位打包
- packbits(myarray[, axis]) 將二進制值數(shù)組的元素打包到uint8數(shù)組中的位中鹤耍。
- unpackbits(myarray[, axis]) 將uint8數(shù)組的元素解包為二進制值輸出數(shù)組肉迫。
輸出格式
- binary_repr(num[, width]) 將輸入數(shù)字的二進制表示形式返回為字符串。