【发布时间】:2015-07-26 13:47:32
【问题描述】:
this post 的 OP 强调了在 pandas 中使用 date_format 参数的文档不足。我想在使用 to_csv 命令时将数据格式化为 YYYY-MM-DD,而不是 MM/DD/YYYY。
我试过了:frame.to_csv(output_dir, index=False, encoding='utf-8', date_format='%Y-%m-%d') 但它不起作用,其中 frame 是一个 DataFrame
可以找到我要转换的文件here
【问题讨论】: