A
Alex van der Spek
Why does this not work?
Traceback (most recent call last):
File "<pyshell#91>", line 1, in <module>
arr=numpy.array(dat,dtype=col)
TypeError: expected a readable buffer object
But this does:
dtype=[('a', '<f4'), ('b', '<f4'), ('c', '<f4')])
The only difference that the object is a list of tuples now?
Thanks for clarification,
Alex van der Spek
dat=[[1,2,3],[4,5,6]]
col=[('a','f4'),('b','f4'),('c','f4')]
arr=numpy.array(dat,dtype=col)
Traceback (most recent call last):
File "<pyshell#91>", line 1, in <module>
arr=numpy.array(dat,dtype=col)
TypeError: expected a readable buffer object
But this does:
array([(1.0, 2.0, 3.0), (4.0, 5.0, 6.0)],dat=[(1,2,3),(4,5,6)]
arr=numpy.array(dat,dtype=col)
arr
dtype=[('a', '<f4'), ('b', '<f4'), ('c', '<f4')])
The only difference that the object is a list of tuples now?
Thanks for clarification,
Alex van der Spek