python pandas Get all the sheet names and table data under the Excel file

Method 1:
Be sure to add sheet_name=None to read all sheets, otherwise the first sheet is read by default, and the obtained keys are the values ​​of the first line

df = pd.read_excel('自己的Excel文件路径.xlsx', sheet_name=None)  # 路径注意转义 
for i in df.keys():
   print(i)

Method 2:

    df = pd.read_excel('自己的Excel文件路径.xlsx', sheet_name=None)
    print(list(df))

Guess you like

Origin blog.csdn.net/zhuan_long/article/details/132140531