【发布时间】:2016-08-17 01:24:41
【问题描述】:
可能这是一个老问题,我在下面找到了类似的问题,但我仍然可以在我的输出文件中看到科学记数法。
Suppressing scientific notation in pandas?
Pandas read scientific notation and change
Python Pandas Scientific Notation Iconsistent
我尝试将set_option 和df.apply(pd.to_numeric, args=('coerce',)) 等合并到我下面的代码中,但不起作用。
df = pd.read_csv(Input)
dfNew = df[['co_A','co_B','co_C']]
# I firstly select columns from df then would like to convert scientific notation to decimal type in my output file.
dfNew.to_csv(Output, index = False, sep = '\t')
我仍然可以在输出文件中看到科学记数法。有人可以帮忙吗?
co_A co_B co_C
167 0.0 59.6
168 0.0 60.6
191 8e-09 72.6
197 -4.7718e-06 12.3
197 0.0 92.4
198 0.0 39.5
【问题讨论】:
标签: python-2.7 pandas