With pure python you can do:
chr(int('0101', base=2))
'A'
On Tue, Nov 29, 2011 at 12:13 PM, Alex Ter-Sarkissov wrote:
> hi eveyone,
>
> is there a simple command in numpy similar to matlab char(bin2dec('//some
> binary value//')) to convert binary to characters and back?
>
> thanks
>
> ___
On Tue, Nov 29, 2011 at 8:13 PM, Alex Ter-Sarkissov wrote:
> hi eveyone,
>
> is there a simple command in numpy similar to matlab char(bin2dec('//some
> binary value//')) to convert binary to characters and back?
>
> thanks
Would the Python struct library do? You'd get a tuple
back from struct.un
Would numpy.fromstring and ndarray.tostring fit your needs?
-=- Olivier
2011/11/29 Alex Ter-Sarkissov
> hi eveyone,
>
> is there a simple command in numpy similar to matlab char(bin2dec('//some
> binary value//')) to convert binary to characters and back?
>
> thanks
>
>
hi eveyone,
is there a simple command in numpy similar to matlab char(bin2dec('//some
binary value//')) to convert binary to characters and back?
thanks
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/