#獲取文件的sheep_name import pandas as pd df=pd.read_excel('my.xlsx',engine='openpyxl',sheet_name='中國疫情') #如果存在多個sheets,sheet_name這個必須指定 print(df.columns.to_list()) #把列名以列表的方式輸出
測試數據文件鏈接:
鏈接: https://pan.baidu.com/s/14pKMmt7aigdMsA_fomfrMQ 密碼: ahtm 如果失效,可以留言