[Tutor] new to python

Steven D'Aprano steve at pearwood.info
Thu Nov 18 23:27:52 CET 2010


gary engstrom wrote:
> Dear Python Tutor,
> 
> Being new to python I was wondering if there is a way to import exel data
> into pyrhon matrix/arrays so that I have some data to work with. I know R
> uses Rcmdr as an easy interface
> for excel data, which helps keep the reader engaged while learning the
> language.


Python doesn't directly support Excel binary formats such as xls, but it 
does support the interchange CSV format. See the csv module:

http://docs.python.org/library/csv.html
http://effbot.org/librarybook/csv.htm

Also, if you write your data to a tab-delimited file, you can just read 
the file line by line, splitting on tabs.

Finally, if you must deal with Excel binary formats, there is at least 
one third-party library that might help. Google for "python excel" for 
links.


-- 
Steven



More information about the Tutor mailing list