pandas read file report list index out of range

import os
import pandas as pd
path = r'C:\\Users...'
excelFile = os.path.join(path,'文件名')
data = pd.read_excel(excelFile)

https://blog.csdn.net/qq_26583361/article/details/102734418

import pandas as pd
data = pd.read_excel(path,sheet_name=1)
directly read the file and report an error IndexError: list index out of range. According to the Internet, there are many redundant rows and columns without data in Excel, but manual deletion is also possible. It is useless, it can be read by the following method:

import os
import pandas as pd
path =
r'file path' excelFile = os.path.join(path,'file name.xls')

data = pd.read_excel(excelFile)

There is no problem
———————————————
Copyright statement: This article is the original article of the CSDN blogger "Annllp", and it follows the CC 4.0 BY-SA copyright agreement. Please attach the original source for reprinting. Link and this statement.
Original link: https://blog.csdn.net/qq_26583361/article/details/102734418

Guess you like

Origin blog.csdn.net/qq_42830971/article/details/114249151