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

Peter Kelley paz117@gmail....
Thu Jul 2 18:30:42 CDT 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