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

2024/9/19 18:33:03

When running the following Python Panda code:

    xl          = pd.ExcelFile(dataFileUrl)sheets      = xl.sheet_namesdata        = 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?

Answer

I would try

xl = pd.ExcelFile(dataFileUrl, engine='xlrd')
https://en.xdnf.cn/q/72511.html

Related Q&A

How to access the keys or values of Python GDB Value

I have a struct in GDB and want to run a script which examines this struct. In Python GDB you can easily access the struct via(gdb) python mystruct = gdb.parse_and_eval("mystruct")Now I got t…

How can I fire a Traits static event notification on a List?

I am working through the traits presentation from PyCon 2010. At about 2:30:45 the presenter starts covering trait event notifications, which allow (among other things) the ability to automatically ca…

Calculate moving average in numpy array with NaNs

I am trying to calculate the moving average in a large numpy array that contains NaNs. Currently I am using:import numpy as npdef moving_average(a,n=5):ret = np.cumsum(a,dtype=float)ret[n:] = ret[n:]-r…

Python: numpy.insert NaN value

Im trying to insert NaN values to specific indices of a numpy array. I keep getting this error:TypeError: Cannot cast array data from dtype(float64) to dtype(int64) according to the rule safeWhen tryin…

Identify external workbook links using openpyxl

I am trying to identify all cells that contain external workbook references, using openpyxl in Python 3.4. But I am failing. My first try consisted of:def find_external_value(cell): # identifies an e…

3D-Stacked 2D histograms

I have a bunch of 2D histograms (square 2D numpy arrays) that I want to stack in 3D like so:(Image from: Cardenas, Alfredo E., et al. "Unassisted transport of N-acetyl-L-tryptophanamide through me…

Python and mySQLdb error: OperationalError: (1054, Unknown column in where clause)

Hey all, Im getting an error OperationalError: (1054, "Unknown column XX in where clause")Where XX is the value of CLASS in the following codeconn = MySQLdb.connect(host = "localhost&quo…

Best Python GIS library? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, argum…

Build a class with an attribute in one line

How do I write a one-liner for the following? class MyClass(): content = {} obj = MyClass()

Python Imports, Paths, Directories Modules

Let me start by saying Ive done extensive research over the course of the past week and have not yet found actual answers to these questions - just some fuzzy answers that dont really explain what is g…