TypeError: read_excel() got an unexpected keyword argument 'encoding'
时间: 2023-10-02 15:12:37 浏览: 326
This error occurs when you are trying to use the 'encoding' parameter with the 'read_excel()' function in Pandas, but the version of Pandas you are using does not support this parameter.
To resolve this error, you can try updating your version of Pandas to the latest version. Alternatively, you can try using a different parameter or method to read your Excel file that supports the 'encoding' parameter.
For example, you can use the 'openpyxl' library to read Excel files with encoding:
```
import openpyxl
# Load the Excel file
workbook = openpyxl.load_workbook('filename.xlsx', read_only=True, data_only=True)
# Select the worksheet
worksheet = workbook['Sheet1']
# Read the data from the worksheet
for row in worksheet.iter_rows(values_only=True):
print(row)
```
阅读全文