Re: [Numpy-discussion] binary to ascii

2011-11-29 Thread G Jones
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 > > ___

Re: [Numpy-discussion] binary to ascii

2011-11-29 Thread Peter
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

Re: [Numpy-discussion] binary to ascii

2011-11-29 Thread Olivier Delalleau
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 > >

[Numpy-discussion] binary to ascii

2011-11-29 Thread 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 ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/