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

后端 未结 11 1270
轮回少年
轮回少年 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:31

    This answer by cs95 removes trailing “.0” in one row.

    df = df.round(decimals=0).astype(object)
    

提交回复
热议问题