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
but when I to txt
t.to_csv('2020.txt',sep='\t',index=False,header=False)
The txt have '.0'
55.0
30.0 70.0
25.0 65.0 85.0
60.0
64.0
Why df have '.0' when I to txt?