今天装了py3.11,但是在导入pandas的时候出现了以下错误:
from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named _bz2很显然缺少了依赖包,可以用
yum install bzip2进行安装,安装之后发现还是…
pandas根据dataframe生成一个excel文件:
Dataframe保存新文件
直接把dataframe格式的数据保存到多个sheet页程序如下:
excel_file "导出excel文件.xlsx"
if os.path.exists(excel_file):os.remove(excel_file)# 生成一个新文件
with pd.Ex…