Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Error read_excel() got an unexpected keyword argument 'encoding' while reading excel(xlsx) files into dataframe

my code is ''' DumpDF=pd.read_excel(Report,encoding='cp1252') ''

Error: Traceback (most recent call last): File "model1_final.py", line 132, in File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\util_decorators.py", line 299, in wrapper return func(*args, **kwargs) TypeError: read_excel() got an unexpected keyword argument 'encoding' 127.0.0.1 - - [13/Feb/2021 09:16:40] "[37mPOST /predict HTTP/1.1[0m" 200 -

Tried replacing encoding with encoding_override, still got same TypeError Traceback (most recent call last): File "model1_final.py", line 132, in File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\util_decorators.py", line 299, in wrapper return func(*args, **kwargs) TypeError: read_excel() got an unexpected keyword argument 'encoding_override' 127.0.0.1 - - [13/Feb/2021 09:16:40] "[37mPOST /predict HTTP/1.1[0m" 200 -

like image 592
Elakkiya Avatar asked Nov 28 '25 02:11

Elakkiya


1 Answers

As you can see here pandas.read_excel does not take/need a (keyword) argument called 'encoding'.

like image 73
Stefan B Avatar answered Nov 30 '25 16:11

Stefan B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!