In [1]:
import pandas as pd
Let us try opening a XLSX file.
In [ ]:
pd.read_excel('test.xlsx')
I got following error...
XLRDError: Excel xlsx file; not supported
In [3]:
pd.__version__
Out[3]:
Well there are couple of ways to fix this problem.
With Pandas < 1.2 version, using engine='openpyxl' option fixes the problem.
In [4]:
df = pd.read_excel('test.xlsx',engine='openpyxl')
In [5]:
df.size
Out[5]:
Another way is to upgrade pandas to >= 1.2 version.
To install pandas, make sure you have Python >= 3.7 version installed.
once you have correct version of Python installed. Just install pandas using pip.
pip install pandas==1.2.4
Now pd.read_excel will just work fine.
In [ ]:
df = pd.read_excel('test.xlsx')
Related Notebooks
- Pandas Read and Write Excel File
- How to Export Pandas DataFrame to a CSV File
- How To Solve Error Numpy Has No Attribute Float In Python
- With Open Statement in Python
- JSON Parse Error Syntax Error Unexpected token N In JSON
- How To Convert Python List To Pandas DataFrame
- How To Use Pandas Correlation Matrix
- How to Sort Pandas DataFrame with Examples
- Pandas How To Sort Columns And Rows