python日常积累

1.先使用 ExcelFile 读成 xlsx 。
2.然后使用使用 read _ excel 读成 df ,最后进行需求实现。
为什么要这样做?目的是步骤1通常初始化一次就可以,但步骤2可能需要多次进行,因为我们通常需要处理的 excel 包含很多个 sheet ,步骤2可以指定要处理那个 sheet 页。如果不这样处理,直接将 file, sheetname 传入 read _ excel ,每一次处理都会耗费很多时间。
使用例子如下:

xlsx = pd . ExcelFile (file1_ path )//通常在主函数中初始化一次 
df = pd . read _ excel ( xlsx , sheet _ name )

参考: pandas : powerful Python data analysis toolkit Release 1.0.5—Page284 To facilitate working with multiple sheets from the same file , the ExcelFile class can be used to wrap the file and can be passed into read-excel There will be a performance benefit for reading multiple sheets into memory only once.
3.批量导出pip列表:pip freeze > requirements.txt
4. 为某个用户安装包 pip install dsvdsv .txt -i 镜像源的路径 --user
5.linux下pyinstaller无法使用export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/python3/bin

6.【python】使用pip出现/bin/python: bad interpreter: No such file or directory https://blog.csdn.net/qq_38486203/article/details/100103434

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值