importing excel data into a python matrix?

John Yeung gallium.arsenide at gmail.com
Thu Sep 2 02:32:23 EDT 2010


On Sep 1, 7:45 pm, Chris Rebert <c... at rebertia.com> wrote:
> On Wed, Sep 1, 2010 at 4:35 PM, patrick mcnameeking
>
> <pmcnameek... at gmail.com> wrote:
> > 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

While I heartily recommend xlrd, it only works with "traditional"
Excel files (extension .xls, not .xlsx).  If the data really is 1000
columns wide, it must be in the new (Excel 2007 or later) format,
because the old only supported up to 256 columns.

The most promising-looking Python package to handle .xlsx files is
openpyxl.  There are also a couple of older .xlsx readers (openpyxl
can write as well).  I have not tried any of these.

John



More information about the Python-list mailing list