我无法理解为什么零点在从int转换为字符串的字符串结尾处添加。
以下是我要转换的代码:
df['attendees_num'].astype(str)
这里的参与者数量值为20,但其输出值为20.0。有人可以帮助我如何将它转换为20作为字符串没有.0在结尾。?
这应该这样做:
df['attendees_num'].astype(int).astype(str)