Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python pandas read_excel error "Value must be either numerical or a string containing a wild card"

I dont know why this error occurs.

pd.read_excel('data/A.xlsx', usecols=["B", "C"])

Then I get this error:

"Value must be either numerical or a string containing a wild card"

So i change my code use nrows all data

pd.read_excel('data/A.xlsx', usecols=["B","C"], nrows=172033)

Then there is no error and a dataframe is created.

my excel file has 172034 rows, 1st is column name.

like image 755
lima Avatar asked Jan 19 '26 14:01

lima


1 Answers

If you deselect all your filters the read_excel function should work.

like image 114
DaFreak Avatar answered Jan 22 '26 04:01

DaFreak