[Tutor] (no subject)

Alan Gauld alan.gauld at yahoo.co.uk
Fri Aug 11 13:01:34 EDT 2023


On 11/08/2023 14:52, Mats Wichmann wrote:
> On 8/11/23 01:31, Avijit Shukla wrote:
>> I need to learn about reading excel files..from system..
>>
>> if possible you can share steps with sample code??
> 
> I think you got one response already 

I think this is the extra "detail" that I asked for.
He wants to *read* excel files *from the system*,
whatever that means!

Taken at face value, I assume he wants to read
the data from a .xlsx file. And for that the best
module is probably xlrd. Although I notice that a
web search suggests pandas.read() can cope with xlsx
files too. But pandas is quite a heavyweight module
if you only want to read the data.

OTOH if you were doing serious data processing
then pandas is probably the best option!

There are plenty pandas tutorials on the web
and on Youtube so I'll let the OP search for those.

The official xlrd module tutorial is here:

https://xlrd.readthedocs.io/en/latest/

You also mentioned openpyxl which I've never used
but notice it can be used to both read and write
which might be an advantage...

I also don't know how any of these tools cope
with tabbed sheets, calculated fields and macros.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos





More information about the Tutor mailing list