[Python] Re: efficient data loading with Python, is that possible possible?
Chris Gonnerman
chris.gonnerman at newcenturycomputers.net
Fri Dec 14 11:44:01 EST 2007
Neil Cerutti wrote:
> An inefficient parsing technique is probably to blame. You first
> inspect the line to make sure it is valid, then you inspect it
> (number of column type) times to discover what data type it
> contains, and then you inspect it *again* to finally translate
> it.
>
I was thinking just that. It is much more "pythonic" to simply attempt
to convert the values in whatever fashion they are supposed to be
converted, and handle errors in data format by means of exceptions.
IMO, of course. In the "trivial" case, where there are no errors in the
data file, this is a heck of a lot faster.
-- Chris.
More information about the Python-list
mailing list