[Python-ideas] csv.DictReader could handle headers more intelligently.

Stephen J. Turnbull turnbull at sk.tsukuba.ac.jp
Tue Jan 29 20:19:30 CET 2013


Eric V. Smith writes:
 > Not true: I process some csv files just to translate them into another
 > format, say tab delimited. I don't care about the column names,
Then you'd be nuts to use csv.DictReader! csv.reader does exactly
what you want.
DictReader is about transforming a data format from a sequence of rows
of values accessed by position, one of which might be a header, to a
headerless sequence of objects with values accessed by name. If your
use case doesn't involve access by name, it is irrelevant.


More information about the Python-ideas mailing list

AltStyle によって変換されたページ (->オリジナル) /