使用熊猫:功能匹配列名,无法执行功能
一个名为“ 等级”的列的客户端给我一个表df.rank.astype(int)函数在列上认为我正在尝试在.rank()函数上运行.astype()函数。有什么方法可以防止这种情况?
df.rank.astype()
AttributeError: 'function' object has no attribute 'astype'
I was given a table by a client named with a column named "rank",
and I'm trying to convert the values in that column to an int type, but when I try to run the df.rank.astype(int) function on the column it thinks I'm trying to run the .astype() function on the .rank() function. Any way to prevent this?
df.rank.astype()
AttributeError: 'function' object has no attribute 'astype'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用[]设置声明列
You can set declare the column using []