[SciPy-User] genfromtxt with missing fields

Ian Stokes-Rees ijstokes@hkl.hms.harvard....
Fri Jun 18 15:30:35 CDT 2010

I have an ASCII file with missing fields.  The entries are tab
delimited, and of mixed type.  The missing field issue is somewhat
different from what "missing_values" and "filling_values" supports: if a
field is missing, it marks the end of the entry (i.e. there is a new
line character).  I cannot work out how to import this.   The command
(an example below) works fine when I remove the fields with missing
data.  Any suggestions on how to cope with this would be greatly


d = genfromtxt('3cdx.snapshot.dat',
    ('scop', 'S6'),
    ('result', 'S12'),
    ('runtime', 'i2'),
    ('rfz', 'f4'),
    ('llginitial', 'i2'),
    ('llg', 'i2')],

More information about the SciPy-User mailing list