importing excel data into a python matrix?

Chris Rebert clp2 at rebertia.com
Thu Sep 2 01:45:39 CEST 2010


On Wed, Sep 1, 2010 at 4:35 PM, patrick mcnameeking
<pmcnameeking at gmail.com> wrote:
> Hello list,
> I've been working with Python now for about a year using it primarily for
> scripting in the Puredata graphical programming environment.  I'm working on
> a project where I have been given a 1000 by 1000 cell excel spreadsheet and
> I would like to be able to access the data using Python.  Does anyone know
> of a way that I can do this?

"xlrd 0.7.1 - Library for developers to extract data from Microsoft
Excel (tm) spreadsheet files":
http://pypi.python.org/pypi/xlrd

If requiring the user to re-save the file as .CSV instead of .XLS is
feasible, then you /can/ avoid the third-party dependency and use just
the std lib instead:
http://docs.python.org/library/csv.html

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list