I can create a recarray and access its members by name:
import numpy as np
n = 20
x = np.recarray((n,), dtype=[('x',int),('y',float),('label',object)])
x.x[:] = range(n)
x.y[:] = np.arange(n)*0.08
x.label[:] = ['%d bottles of beer on the wall' % i for i in range(n)]
and I can access the data by row index, or iterate over the rows:
>>> print x[3]
(3, 0.24, '3 bottles of beer on the wall')
But how can I iterate over the fields or get the k
th field in the recarray?