Hi,<br><br>I have used bitarray for that<br><br>  <a href="http://pypi.python.org/pypi/bitarray/">http://pypi.python.org/pypi/bitarray/</a><br><br>Here<br><br>  <a href="http://code.google.com/p/pylibtiff/source/browse/#svn%2Ftrunk%2Flibtiff%2Fbitarray-0.3.5-numpy">http://code.google.com/p/pylibtiff/source/browse/#svn%2Ftrunk%2Flibtiff%2Fbitarray-0.3.5-numpy</a><br>
<br>you can find bitarray with numpy support.<br><br>HTH,<br>Pearu<br><br><div class="gmail_quote">On Mon, May 16, 2011 at 9:55 PM, Nikolas Tautenhahn <span dir="ltr"><<a href="mailto:virtual@gmx.de">virtual@gmx.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<br>
for some research, I need to convert lots of integers into their bit<br>
representation - but as a bit array, not a string like<br>
numpy.binary_repr() returns it.<br>
<br>
So instead of<br>
In [22]: numpy.binary_repr(23)<br>
Out[22]: '10111<br>
<br>
<br>
I'd need:<br>
numpy.binary_magic(23)<br>
Out: array([ True, False,  True,  True,  True], dtype=bool)<br>
<br>
is there any way to do this efficiently?<br>
<br>
best regards,<br>
Nik<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div><br>