brainevent.bitpack

Contents

brainevent.bitpack#

brainevent.bitpack(arr, axis)[source]#

Pack a boolean array into uint32 words along the given axis.

Each uint32 word stores 32 binary values. Bit b of word w corresponds to element w * 32 + b along the packed axis.

Parameters:
  • arr (Array) – Input array (any dtype; non-zero values are treated as True).

  • axis (int) – Axis along which to pack.

Returns:

Packed uint32 array. The packed axis has length ceil(arr.shape[axis] / 32).

Return type:

Array