【发布时间】:2020-04-21 06:00:10
【问题描述】:
t=pd.DataFrame(tree_pre)
t.fillna('',inplace=True)
print(t)
0 1 2 3 4 5 6 7 8
0 55
1 30 70
2 25 65 85
3 60
4 64
但是当我要 txt 时
t.to_csv('2020.txt',sep='\t',index=False,header=False)
txt 有 '.0'
55.0
30.0 70.0
25.0 65.0 85.0
60.0
64.0
为什么我在 txt 时 df 有 '.0'?
【问题讨论】: