need fast parser for comma/space delimited numbers

Michael A. Miller mmiller3 at iupui.edu
Sun Mar 19 17:36:51 EST 2000


>>>>> "Les" == Les Schaffer <godzilla at netmeg.net> writes:

    >> TableIO [1] does exactly what you're looking for and is
    >> reasonably fast I think.

    > oh, one other thing. my data files will have varied numbers
    > of columns per file. does your parser check automatically
    > for column width?

It checks that the number of fields in each non-comment line is
constant.  I think that part would be fairly simple to remove.
My original intention for the module was to move the
string-to-float conversions from Python to C to speed up the
reading of tabular data in rectangular arrays.  Although the
wrapper returns NumPy arrays, the C module returns a dictionary
that contains a list of numbers.  It would be fairly simple to
remove the column number checking and to return a list of lists,
where each line was converted to a list of appropriate length.

Mike

-- 
Michael A. Miller                      mmiller3 at iupui.edu
  Krannert Institute of Cardiology, IU School of Medicine



More information about the Python-list mailing list