[Numpy-discussion] Using loadtxt to read in mixed data types

Peter Kelley paz117 at gmail.com
Thu Jul 2 19:30:42 EDT 2009


Thanks Pierre,

For some reason

'formats':[eval(b) for b in event_format]

didn't work, but as you said should it fail try

dtype([(x,eval(b)) for (x,b) in zip(event_fields, event_format)])

which seems to be working.

Interestingly before when I had typed this out by hand, both using
tuples and a dictionary seemed to work as they should.

Thanks again,

-Peter



More information about the NumPy-Discussion mailing list