【发布时间】:2018-07-29 03:52:05
【问题描述】:
This is what the dataframe looks like before exporting
四舍五入不是我想要的;我希望 txt.file 中的文本看起来像控制台中显示的那样。那么我该如何解决这个问题呢?有什么简单的解决方案吗?
【问题讨论】:
标签: python-3.x pandas file dataframe rounding
This is what the dataframe looks like before exporting
四舍五入不是我想要的;我希望 txt.file 中的文本看起来像控制台中显示的那样。那么我该如何解决这个问题呢?有什么简单的解决方案吗?
【问题讨论】:
标签: python-3.x pandas file dataframe rounding
您是否尝试过直接从 Pandas 数据框编写而不是通过 Numpy?
试试DF.to_csv(‘output.txt’, sep=‘\t’, float_format=‘%g’)
【讨论】: