Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a=numpy.array([1, 2, 3, 4, 5, 6,]);
- b=numpy.array([7,8,9]);
- c=numpy.array([10,11,12,13,14,15,16,17,18,19,20]);
- ##Doesn't do what I want
- data=numpy.array([a, b, c],dtype=[('a','f8'),('b','f8'),('c','f8')]);
- >>> data = {'a':a, 'b':b, 'c':c}
- >>> data['a'] is a
- True
- >>> np.zeros(3,dtype=[('a',(int,3)),('b',(float,5))])
- >>> x=np.zeros(3, dtype=[('a',object), ('b',object)])
- >>> x['a'][0] = [1,2,3,4]
- >>> x['b'][-1] = "ABCDEF"
- >>> print x
- [([1, 2, 3, 4], 0) (0, 0) (0, 'ABCD')]
- blob = np.array([(a,b,c)],dtype=[('a',object),('b',object),('c',object)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement