[Numpy-discussion] how to set a fixed sized dtype suitable for bitwise operations

Benjamin Root ben.root at ou.edu
Tue Apr 28 10:00:41 EDT 2015


I have a need to have a numpy array of 17 byte (more specifically, at least
147 bits) values that I would be doing some bit twiddling on. I have found
that doing a dtype of "i17" yields a dtype of int32, which is completely
not what I intended. Doing 'u17' gets an "data type not understood". I have
tried 'a17', but then bitwise_or() and left_shift() do not work (returns
"NotImplemented").

How should I be going about this?

Cheers!
Ben Root
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20150428/21f62b29/attachment.html>


More information about the NumPy-Discussion mailing list