问题描述:
有如下代码:

list = [1,2,3]
list = list(df.columns[df.isnull().sum() > 0])  #df.columns[df.isnull().sum() > 0]是Index类型,返回df中所有有空值的列的index,list()函数将后面的Index转换为列表类型

在运行上述代码时,报错:TypeError: ‘list’ object is not callable

解决方法:
变量list和函数list重名了,将变量list改成其他名字即可。

TypeError: 'list' object is not callable相关推荐

  1. TypeError: 'module' object is not callable 原因分析

    程序代码  class Person:      #constructor      def __init__(self,name,sex):           self.Name = name   ...

  2. Python报错TypeError: 'str' object is not callable

    原文:http://blog.sina.com.cn/s/blog_71f3890901017rsh.html Python报错TypeError: 'str' object is not calla ...

  3. Python:TypeError: 'int' object is not callable

    一个函数的部分代码如下: [python] view plain copy def loadData(): ...... len = dataSet.__len__() trainingSet.ext ...

  4. Python导入模块(包)的两种方式 TypeError: 'module' object is not callable

    Python编程时明明在开始处import了相关包,但是调用函数时就报错如下: TypeError: 'module' object is not callable Python中有两种导入包(模块, ...

  5. TypeError: 'module' object is not callable 原因分析(python模块导入注意事项)

    程序代码  class Person:      #constructor      def __init__(self,name,sex):           self.Name = name   ...

  6. 成功解决TypeError: ‘tuple‘ object is not callable

    成功解决TypeError: 'tuple' object is not callable 目录 解决问题 解决思路 解决方法 解决问题 TypeError: 'tuple' object is no ...

  7. 成功解决TypeError: ‘str‘ object is not callable

    成功解决TypeError: 'str' object is not callable 目录 解决问题 解决思路 解决方法 解决问题 TypeError: 'st

  8. python nonetype_python装饰器 ——@符号与“TypeError: ‘NoneType’ object is not callable” | 学步园...

    今天来讨论一下装饰器.装饰器是一个很著名的设计模式,经常被用于有切面需求的场景,较为经典的有插入日志.性能测试.事务处理等.装饰器是解决这类问题的绝佳设计,有了装饰器,我们就可以抽离出大量函数中与函数 ...

  9. Python错误:TypeError: 'list' object is not callable

    前言 在学习并使用Python的过程中,总会遇到各种各样的错误,因此,写下整个系列的帖子,方便自己回顾,也方便其他同学参阅. 正文 在Python运行过程中遇到了如下错误: TypeError: 'l ...

  10. python报错:TypeError: 'str' object is not callable

    这个问题遇到好多次了,这次记录一下, 问题重现 代码仅保留最重要的: # summaries 是一个集合 # 求和并打印 result = 0 for str in summaries: result ...

最新文章

  1. 第一个使用计算机图形学术语,计算机图形学考题
  2. UA MATH566 一个例子:什么是隐状态
  3. 信息学奥赛一本通(C++)在线评测系统——基础(一)C++语言——1099:第n小的质数
  4. spring MVC 工作原理
  5. rhq监控软件_RHQ指标的WildFly子系统
  6. 资产模型数据初始化时应注意的事项
  7. bom实现方块移动_html5实现简单的拼图小游戏
  8. 在PyCharm命令行中使用conda数学库的方法
  9. python线性拟合numpypolyfit_python – 具有适配参数的numpy.polyfit
  10. SpringCloud和AlibabaCloud区别
  11. 手机用USB连接电脑宽带上网(只需轻松3步即可上网)
  12. sudoku_solver :数独解题器
  13. 企业网络安全区域划分的原则和方法
  14. word2016页码都是一样的这样解决,详细全过程
  15. PHP爆绝对路径方法
  16. 模拟二进制交叉算子(SBX)与多项式变异(PM)
  17. oracle 11g函数包缓存,Oracle 11g 的PL/SQL函数结果缓存
  18. 无法卸载vue2.x提示up to date
  19. 手机5g什么时候普及_5g什么时候普及民用
  20. 两例司法实践撕开了一个口子,区块链应用落地会加速吗?

热门文章

  1. 浅谈Event Loop
  2. 计算字符串的相似度-两种解法
  3. 算法设计与分析复习——第四章:贪心算法
  4. springMVC学习(1)
  5. Linux磁盘管理基本配置
  6. 云南满泽生物科技有限公司 满泽玛卡玛咖精片 东革阿里 奶昔
  7. SSH框架下 Proxool 连接池配置
  8. UNIX linux vi命令
  9. BGSOUND与EMBED的区别
  10. 鸿蒙os运行内存,体验亮点满满!鸿蒙OS系统6月份开启适配,不只有华为手机