I want to convert the record [(1, 2, 3) (2, 2, 3)] which is of integer type to floating type array as [(1.0, 2.0, 3.0), (2.0, 2.0, 3.0)]. However when I give the command c.astype('float') what I get at the output is rec.array([ 1., 2.]). Why the other elements are deleted from the array?
Could someone please give me the correct solution?
Am I doing it the right way?
Update
I created the record from 3 different arrays like this –
d=np.rec.fromarrays([a, b, c], names='x,y,z') in order to sort them and do some operations.
Here is the complete code –
a=[1,2]
b=[2,2]
c=[3,3]
d=np.rec.fromarrays([a, b, c], names='x,y,z')
print d
d.astype('float')
print d
Inelegant but (apparently) working: