Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you read excel sheets using index instead of name with pandas.read_excel?

I know this is easily done with pandas.io.parser ExcelFile but the documentation says that they are dropping ExcelFile from future versions of pandas so I was wondering how to do this with its replacement read_excel().

The documentation says that you can use a sheet index by doing the following:

read_excel('path_to_file.xls', 0, index_col=None, na_values=['NA'])

Every time I try this I get the following error:

XLRDError: No sheet named <0>
like image 964
cmgerber Avatar asked Nov 04 '13 02:11

cmgerber


1 Answers

I think you're on the wrong version, this feature is new to version 0.13, which hasn't been released just yet.

like image 119
aIKid Avatar answered Oct 22 '22 06:10

aIKid