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

2023年6月9日

摘要: 来自:https://devpress.csdn.net/chengdu/647f47c2ade290484cb2ec32.html, 感谢作者 前言 本文主要简单介绍一下使用python的pandas库来将数据写入到excel文件中。 一、pandas是什么? 示例:pandas 是基于NumPy 阅读全文

posted @ 2023-06-09 13:40 小翁好 阅读(854) 评论(0) 推荐(0) 编辑

摘要: 来自:https://blog.csdn.net/weixin_44852067/article/details/122366383, 感谢作者。 pandas中的read_csv参数详解 独影月下酌酒 于 2022-01-07 15:57:29 发布 40866 收藏 204分类专栏: panda 阅读全文

posted @ 2023-06-09 13:34 小翁好 阅读(2206) 评论(0) 推荐(0) 编辑

摘要: 用pandas读取csv格式文件时,里面有的行比前面的行 多出好多列,会报下面的错 df = pd.read_csv(file_name_csv,encoding="GBK") File "pandas\_libs\parsers.pyx", line 905, in pandas._libs.pa 阅读全文

posted @ 2023-06-09 11:53 小翁好 阅读(324) 评论(0) 推荐(0) 编辑

2022年12月29日

摘要: 在运行脚本时,运行到这边这行的时候 query_data['msisdn'].to_csv(file_name_msisdn, index=False) 报出了提示性的错误信息: package_ordering_auto_turn_on.py:332: FutureWarning: The sig 阅读全文

posted @ 2022-12-29 23:07 小翁好 阅读(68) 评论(0) 推荐(0) 编辑

2022年12月25日

摘要: 执行python脚本时,第102行报错如下: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if co 阅读全文

posted @ 2022-12-25 16:02 小翁好 阅读(364) 评论(0) 推荐(0) 编辑

2022年12月19日

摘要: crontab 详细用法 定时任务 转自:http://blog.chinaunix.net/uid-25785357-id-3434344.html 使用crontab你可以在指定的时间执行一个shell脚本或者一系列Linux命令。例如系统管理员安排一个备份任务使其每天都运行 如何往 cron 阅读全文

posted @ 2022-12-19 14:04 小翁好 阅读(36) 评论(0) 推荐(0) 编辑

2022年6月7日

摘要: python写入csv 用Excel打开乱码的解决方法 来自:https://blog.csdn.net/gwruiki/article/details/123645329,感谢作者。 主要是因为编码格式不对,不能使用encoding='utf-8',改为encoding='GB18030'即可下面 阅读全文

posted @ 2022-06-07 23:45 小翁好 阅读(273) 评论(0) 推荐(0) 编辑

2022年6月4日

摘要: 在运行python 脚本时,报错如下 f = open(file_name, 'r', encoding='utf-8')TypeError: expected str, bytes or os.PathLike object, not NoneType 这是因为我在前面的脚本 在生成文件名字的时候 阅读全文

posted @ 2022-06-04 13:30 小翁好 阅读(416) 评论(0) 推荐(0) 编辑

2022年1月17日

摘要: 1. 删除文件: def delete_file(file_name): if os.path.exists(file_name): os.remove(file_name) print('临时文件 %s 已被删除' % file_name) else: pass print('要删除的临时文件 % 阅读全文

posted @ 2022-01-17 10:08 小翁好 阅读(55) 评论(0) 推荐(0) 编辑

2022年1月6日

摘要: 来自:https://www.cnblogs.com/Lival/category/674522.html,感谢作者。 一、try...except 有时候我们写程序的时候,会出现一些错误或异常,导致程序终止。例如,做除法时,除数为0,会引起一个ZeroDivisionError 例子: 1 2 3 阅读全文

posted @ 2022-01-06 09:59 小翁好 阅读(74) 评论(0) 推荐(0) 编辑