CSV, lists, and functions

Roy Smith roy at panix.com
Tue Mar 19 21:37:34 EDT 2013


In article <mailman.3540.1363742997.2939.python-list at python.org>,
 Dave Angel <davea at davea.name> wrote:

> But you should switch to using the csv module.  And unless you have data 
> that consists of millions of lines, you should just read the whole thing 
> in once, and then extract the various columns by simple list 
> manipulations and/or comprehensions.

Another possibility is to use pandas (http://pandas.pydata.org/).  It's 
a bit of effort to master the package, but it's got some neat stuff in 
it.  Apropos to this thread, it has a very flexible read_csv() function.  
You can pass it, for example, skiprows=6, and it'll, well, skip the 
first 6 rows.



More information about the Python-list mailing list