0
点赞
收藏
分享

微信扫一扫

完美解决TypeError: ‘method‘ object is not subscriptable


完美解决TypeError: ‘method‘ object is not subscriptable

完美解决TypeError: ‘method‘ object is not subscriptable_开发语言


文章目录

  • 报错问题
  • 解决方法
  • 声明


报错问题

之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一定针对所有情况都能用,但是可以供大家参考。
问题描述如下:

TypeError: ‘method‘ object is not subscriptable

类型错误:"方法"对象不可subscriptable,意思是你不该有下标的地方用了下标

完美解决TypeError: ‘method‘ object is not subscriptable_解决方法_02

解决方法

完美解决TypeError: ‘method‘ object is not subscriptable_开发语言_03

data_frame.replace[‘女’,‘男’]
改为
data_frame.replace(‘女’,‘男’)

声明

解决方法参考网络,如有侵权联系我删除


举报

相关推荐

0 条评论