Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Must explicitly set engine if not passing in buffer or path for io" in Panda

When running the following Python Panda code:

    xl          = pd.ExcelFile(dataFileUrl)
    sheets      = xl.sheet_names
    data        = xl.parse(sheets[0])
    colheaders  = list(data)

I receive the ValueError:

Must explicitly set engine if not passing in buffer or path for io

The file is for sure an excel file, no doubt about that.

What is happening?

like image 348
JohnAndrews Avatar asked Mar 22 '17 11:03

JohnAndrews


2 Answers

I would try

xl = pd.ExcelFile(dataFileUrl, engine='xlrd')
like image 124
Stael Avatar answered Sep 26 '22 03:09

Stael


I had this same problem and it was because the code that generated dataFileUrl produced a list with only one element in it. Changing to dataFileUrl[0] fixed the problem.

like image 40
Aaron Highsmith Avatar answered Sep 27 '22 03:09

Aaron Highsmith