ITPub博客

首页 > IT职业 > IT职场 > 怎样用jupyter导入excel数据

怎样用jupyter导入excel数据

IT职场 作者:britain 时间:2021-09-11 10:23:06 0 删除 编辑

怎样用jupyter导入excel数据?

Jupyter notebook只能打开当前目录下的数据集

相关推荐:jupyter教程

excel

有两种方法

#用pd包中的read_excel方法
datasets2=pd.read_excel('汇总-京东.xlsx')
print(datasets2.head())

结果

a7a9fa1f270e1502dd0c5af81a59e4b.png

#用pd包中的ExcelFile方法
fileNameStr='汇总-京东.xlsx'
xls = pd.ExcelFile(fileNameStr)
salesDf = xls.parse('京东汇总')
salesDf.head(3)

结果

203f77430fd1a3f2d97d16984bb9182.png

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2317/viewspace-2834757/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-16

  • 博文量
    72
  • 访问量
    628