Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14243

"Number of passed names did not match number of header fields in the file" Error while using read_excel in Pandas

$
0
0

Getting this exception while using read_excel function in pandas.

I am trying to fetch columns based on the column labels in the header. And getting this error. Can anyone tell me where I am going wrong.

Here's the function:

pd.read_excel(myexcel.xlsx, sheet_name = 'sheet1', names = ['company name', 'service provided'], header = 1)

Getting the following error when I run it:

"Number of passed names did not match number of header fields in the file"


Viewing all articles
Browse latest Browse all 14243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>