Bitwise Operations

9 tutorials Updated 8 Oct 2024

  1. 1 binary_repr() function of numpy The binary_repr() function of numpy returns a string of binary bits for a given decimal and Boolean values. The input values are numpy scalars of decimal type. 8 Oct 2024
  2. 2 The bitwise_and() function of NumPy module The Numpy function bitwise_and() applies bitwise AND operation between the elements of two array-like instances and returns the results as an ndarray or a scalar. 24 Sep 2024
  3. 3 bitwise_invert() function of NumPy module For the numpy array-like instances containing elements of Boolean or Integer types the function bitwise_invert() flips the binary bits of the elements. 1 Oct 2024
  4. 4 The bitwise_or() function of NumPy module The numpy function bitwise_or() works on two numpy array-like instances. The integer elements of each member is done a bitwise OR and the result is returned as an ndarray. 24 Sep 2024
  5. 5 bitwise_xor() function of NumPy module The bitwise_XOR() function of numpy module applies XOR operation between the elements of two array-like instances and returns the results. One of the instances can be a numpy scalar. 27 Sep 2024
  6. 6 left_shift() function of numpy module By applying the numpy.left_shift() function, the bit-pattern of the elements of array one are left-shifted by the number of times the corresponding element in array2 and replaced by the same number of zeros on the right side. 1 Oct 2024
  7. 7 packbits() function of numpy The packbits() packs the binary bits from the rows and columns of a numpy ndarray into numpy.uint8 instances. 3 Oct 2024
  8. 8 right_shift() function of numpy module The right_shift() function of numpy shifts the bit pattern of an element pertaining to an ndarray to the number of times n as specified by the corresponding element of the another ndarray. 2 Oct 2024
  9. 9 unpackbits() function of numpy The unpackbits() function creates an ndarray of binary bits from an ndarray of uint8. The Python example unpacks using the axis values both 0 and 1. 5 Oct 2024