当前位置:   article > 正文

使用 pandas 读取 excel 表格之读取指定的子表 sheet_pandas读取excel指定sheet

pandas读取excel指定sheet

我的pandas视频教程

pandas读取excel使用 read_excel() 函数

  1. import pandas as pd
  2. df = pd.read_excel('goods_base.xlsx')

sheet_name 参数, 指定读取 sheet 子表

  1. # 单个sheet
  2. df = pd.read_excel('sheet_name.xlsx', sheet_name=2)
  3. df = pd.read_excel('sheet_name.xlsx', sheet_name='3月')
  4. # 多个sheet, 返回字典
  5. df_dict = pd.read_excel('sheet_name.xlsx', sheet_name=[1, '3月'])
  6. # 全部sheet, 返回字典
  7. df_dict = pd.read_excel('sheet_name.xlsx', sheet_name=None)

 

【Python】Pandas 1.0 数据分析 & Excel 办公自动化 超详细动画可视化讲解 (2020 持续更新 ) 自动化办公

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/209603
推荐阅读
相关标签
  

闽ICP备14008679号