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