On Tue, May 17, 2011 at 8:05 AM, Pearu Peterson wrote:
>
>
> On Tue, May 17, 2011 at 12:04 AM, Nikolas Tautenhahn wrote:
>
>> Hi,
>>
>> > Here
>> >
>> >
>> http://code.google.com/p/pylibtiff/source/browse/#svn%2Ftrunk%2Flibtiff%2Fbitarray-0.3.5-numpy
>> >
>> > you can find bitarray with numpy supp
On Tue, May 17, 2011 at 12:04 AM, Nikolas Tautenhahn wrote:
> Hi,
>
> > Here
> >
> >
> http://code.google.com/p/pylibtiff/source/browse/#svn%2Ftrunk%2Flibtiff%2Fbitarray-0.3.5-numpy
> >
> > you can find bitarray with numpy support.
> >
>
> Thanks, that looks promising - to get a numpy array, I ne
Here's a one-liner:
In [31]: x=np.arange(-8,8)
In [32]: x
Out[32]: array([-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7])
In [33]: 1&(x[:,np.newaxis]/2**np.arange(3,-1,-1))
Out[33]:
array([[1, 0, 0, 0],
[1, 0, 0, 1],
[1, 0, 1, 0],
[1, 0, 1, 1],
[1, 1,
Hi,
> Here
>
> http://code.google.com/p/pylibtiff/source/browse/#svn%2Ftrunk%2Flibtiff%2Fbitarray-0.3.5-numpy
>
> you can find bitarray with numpy support.
>
Thanks, that looks promising - to get a numpy array, I need to do
numpy.array(bitarray.bitarray(numpy.binary_repr(i, l)))
for an inte
Hi,
I have used bitarray for that
http://pypi.python.org/pypi/bitarray/
Here
http://code.google.com/p/pylibtiff/source/browse/#svn%2Ftrunk%2Flibtiff%2Fbitarray-0.3.5-numpy
you can find bitarray with numpy support.
HTH,
Pearu
On Mon, May 16, 2011 at 9:55 PM, Nikolas Tautenhahn wrote:
> H
Hi,
for some research, I need to convert lots of integers into their bit
representation - but as a bit array, not a string like
numpy.binary_repr() returns it.
So instead of
In [22]: numpy.binary_repr(23)
Out[22]: '10111
I'd need:
numpy.binary_magic(23)
Out: array([ True, False, True, True,