在Pandas中,你可以使用read_excel函数的sheet_name=None参数来将一个Excel工作簿中的所有工作表读取到一个字典中³。以下是一个示例代码:

import pandas as pd

# 读取Excel文件中的所有工作表
xls = pd.read_excel('你的文件名.xlsx', sheet_name=None)

# 打印所有工作表的名称和对应的DataFrame
for sheet_name, df in xls.items():
    print(sheet_name)
    print(df)

在这个示例中,read_excel函数的sheet_name=None参数会返回一个字典,其中键是工作表的名称,值是对应的DataFrame³。然后,你可以遍历这个字典并打印每个工作表的名称和对应的DataFrame³。(1) How to convert a worksheet to a Data frame in Pandas?. https://stackoverflow.com/questions/45310787/how-to-convert-a-worksheet-to-a-data-frame-in-pandas.

(2) Write dictionary of dataframes to separate excel sheets. https://stackoverflow.com/questions/57209564/write-dictionary-of-dataframes-to-separate-excel-sheets.

(3) Save list of DataFrames to multisheet Excel spreadsheet. https://stackoverflow.com/questions/14225676/save-list-of-dataframes-to-multisheet-excel-spreadsheet.

(4) How to Convert Pandas DataFrame to a Dictionary - Data to Fish. https://datatofish.com/pandas-dataframe-to-dictionary/.

(5) Creating dictionary from excel workbook in python using sheet names as .... https://stackoverflow.com/questions/44764159/creating-dictionary-from-excel-workbook-in-python-using-sheet-names-as-key.