Bit Array
- class npstructures.BitArray(data: ndarray, bit_stride: int, shape: tuple, offset: int = 0)[source]
- classmethod pack(array: ndarray, bit_stride: int) BitArray [source]
Pack a numpy array into n-bit encoded array
Pack an array where all values can be represented in bit_stride bits into a bit_stride-bit encoded array
- Parameters:
- cls
- arraynp.ndarray
Values to be packed
- bit_strideint
N-bits per entry
- Returns:
- “BitArray”
BitArray with packed values