From: Stefan v. d. W. <st...@su...> - 2006-11-09 08:59:25
|
On Thu, Nov 09, 2006 at 03:18:57AM -0500, Colin J. Williams wrote: >=20 > >>> import numpy.core as _n > >>> _nt=3D _n.numerictypes > >>> value=3D=20 > '\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00= \x00\x00\x00\x08@\x00\x00\x00\x00\x00\x00\x10@\x00\x00\x00\x00\x00\x00\x1= 4@\x00\x00\x00\x00\x00\x00\x18@' > >>> _n.array(value, dtype=3D _nt.complex128, copy=3DTrue) > Traceback (most recent call last): > File "<interactive input>", line 1, in <module> > TypeError: a float is required > >>> If I understand correctly, you would like to create an array from a buffer: In [12]: N.frombuffer(value,dtype=3DN.complex128) Out[12]: array([ 1.+2.j, 3.+4.j, 5.+6.j]) Cheers St=E9fan |