[Numpy-discussion] numpy and bitwise arrays?

Travis E. Oliphant oliphant@enthought....
Wed Jan 21 09:41:45 CST 2009


Muhammad Alkarouri wrote:
> --- On Wed, 21/1/09, Stéfan van der Walt <stefan@sun.ac.za> wrote:
>
>   
>> From: Stéfan van der Walt <stefan@sun.ac.za>
>>     
> ...
>   
>> You can also take a look at Ilan Schnell's bitarray:
>>
>> http://pypi.python.org/pypi/bitarray/
>>     
>
> Looks good to me. Thanks for the suggestion.
>   

You might also make use of the NumPy functions:

packbits
unpackbits
fromfile

Read the bits in as uint8 data using fromfile.

Then, you can manipulate them either using bit twiddling or with 
indexing operations after unpacking to boolean arrays.


-Travis



More information about the Numpy-discussion mailing list