mode.py中verbose_name用中文报错记录

(unicode error) 'utf-8' codec can't decode byte 0xb3 in position 2: invalid start byte (models.py)

在mode.py开头添加一个# -*- coding:utf-8 -*-

C:\Users\Gentle\AppData\Local\Temp\ipykernel_6808\4070415186.py:2: FutureWarning: As the xlwt package is no longer maintained, the xlwt engine will be removed in a future version of pandas. This is the only engine in pandas that supports writing in the xls format. Install openpyxl and write to an xlsx file instead. You can set the option io.excel.xls.writer to 'xlwt' to silence this warning. While this option is deprecated and will also raise a warning, it can be globally set and the warning suppressed. data.to_excel('clean_beautymakeup.xls',sheet_name='clean_data') --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[41], line 2 1 # 保存清理好的数据为Excel格式 ----> 2 data.to_excel('clean_beautymakeup.xls',sheet_name='clean_data') File ~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\util\_decorators.py:211, in deprecate_kwarg.._deprecate_kwarg..wrapper(*args, **kwargs) 209 else: 210 kwargs[new_arg_name] = new_arg_value --> 211 return func(*args, **kwargs) File ~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\util\_decorators.py:211, in deprecate_kwarg.._deprecate_kwarg..wrapper(*args, **kwargs) 209 else: 210 kwargs[new_arg_name] = new_arg_value --> 211 return func(*args, **kwargs) File ~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\core\generic.py:2374, in NDFrame.to_excel(self, excel_writer, sheet_name, na_rep, float_format, columns, header, index, index_label, startrow, startcol, engine, merge_cells, encoding, inf_rep, verbose, freeze_panes, storage_options) 2361 from pandas.io.formats.excel import ExcelFormatter 2363 formatter = ExcelFormatter( 2364 df, 2365 na_rep=na_rep, (...) 2372 inf_rep=inf_rep, 2373 ) -> 2374 formatter.write( ... ---> 48 import xlwt 50 engine_kwargs = combine_kwargs(engine_kwargs, kwargs) 52 if mode == "a": ModuleNotFoundError: No module named 'xlwt'
最新发布
05-28
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值