O'Reilly logo
  • Anthony Plunkett thinks this is interesting:

It’s also important to emphasize that csv does not try to interpret the data or convert it to a type other than a string. If such conversions are important, that is something you’ll need to do yourself. Here is one example of performing extra type conversions on CSV data:

col_types = [str, float, str, str, float, 


Cover of Python Cookbook, 3rd Edition


Importing a CSV file and converting datatypes on the fly.