July 21, 2010
8:41 p.m.
On Jul 21, 2010, at 4:35 PM, wheres pythonmonks wrote:
What about:
idx_by_name = dict(enumerate(d.dtype.names))
Then I can look up the index of the columns I want before the loop, and then access by the index during the loop.
Sure. Why don't you try both approaches, time them and document it ? I still bet that manipulating tuples of numbers might be easier and more performant than juggling w/ the fields of a numpy.void, but that's a gut feeling only...