#获取文件的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


如果失效,可以留言

相关文章:

  • 2022-12-23
  • 2021-08-11
  • 2021-09-22
  • 2022-02-08
  • 2022-01-10
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-16
  • 2022-12-23
相关资源
相似解决方案