how to round/remove traling “.0” zeros in pandas column?

后端 未结 11 1278
轮回少年
轮回少年 2020-12-06 10:15

I\'m trying to see if I can remove the trailing zeros from this phone number column.

Example:

0
1      8.00735e+09
2      4.35789e+09
3      6.10644e         


        
11条回答
  •  死守一世寂寞
    2020-12-06 10:28

    If somebody is still interesting: I had the problem that I round the df and get the trailing zeros. Here is what I did.

    new_df = np.round(old_df,3).astype(str)
    

    Then all trailing zeros were gone in the new_df.

提交回复
热议问题