博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

运行to_csv时报错

Posted on 2022-12-29 23:07  小翁好  阅读(68)  评论(0编辑  收藏  举报
在运行脚本时,运行到这边这行的时候
query_data['msisdn'].to_csv(file_name_msisdn, index=False) 

报出了提示性的错误信息:


package_ordering_auto_turn_on.py:332: FutureWarning: The signature of `Series.to_csv` was aligned to that of `DataFrame.to_csv`, and argument 'header' will change its default value from False to True: please pass an explicit value to suppress this warning.


query_data['msisdn'].to_csv(file_name_msisdn, index=False)

 

根据提示可以知道,to_csv中的参数没有header, 添加了header=False后, 不再报这个错误

query_data['msisdn'].to_csv(file_name_msisdn, index=False,header=False)