p0V,p1V,pSpam=trainNBO(array[trainMat],array(trainClasses))

改为:

p0V,p1V,pSpam=trainNBO(array(trainMat]),array(trainClasses))

【python问题系列--3】TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'的更多相关文章

  1. TypeError: 'Item' object has no attribute '__getitem__'

    Error Msg: Traceback (most recent call last): File "start.py", line 8, in <module> E ...

  2. AttributeError: 'builtin_function_or_method' object has no attribute 'reshape'

    AttributeError: 'builtin_function_or_method' object has no attribute 'reshape' 读取.mat文件时,copy没加括号

  3. 'builtin_function_or_method' object has no attribute 'translate'

    'builtin_function_or_method' object has no attribute 'translate' 首先这个错误的意思是:内建函数或方法对象不能转换成对应的属性. #错误 ...

  4. 'NoneType' object has no attribute '__getitem__'

    报错 'NoneType' object has no attribute '__getitem__' 你 result 返回的是 None ,所以 result [0] 取不了值

  5. Python学习笔记1 -- TypeError: 'str' object is not callable

    Traceback (most recent call last): File "myfirstpython.py", line 39, in <module> pri ...

  6. python报错:TypeError: 'int' object is not subscriptable

    检查一遍报错的所在行,此报错一般是在整数上加了下标: 比如:   a = 4   c=a[2] 报错:line 2, in <module>    c=a[2] TypeError: 'i ...

  7. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  8. 【.NET调用Python脚本】C#调用python requests类库报错 'module' object has no attribute '_getframe' - IronPython 2.7

    最近在开发微信公众号,有一个自定义消息回复的需求 比如用户:麻烦帮我查询一下北京的天气? 系统回复:北京天气,晴,-℃... 这时候需要根据关键字[北京][天气],分词匹配需要执行的操作,然后去调用天 ...

  9. Python脚本报错AttributeError: 'module' object has no attribute 'maketrans'

    出现此错误的原因:是此文件smtp02.py 所在的目录下有string.pyc 的文件存在,与python库里的string.pyc冲突造成无法确认编译所取的类库.

随机推荐

  1. Java NIO Channel之FileChannel [ 转载 ]

    Java NIO Channel之FileChannel [ 转载 ] @author zachary.guo 对于文件 I/O,最强大之处在于异步 I/O(asynchronous I/O),它允许 ...

  2. ToString() 格式化

    c# ToString() 格式化字符串  格式化数值:有时,我们可能需要将数值以一定的格式来呈现,就需要对数值进行格式化.我们使用格式字符串指定格式.格式字符串采用以下形式:Axx,其中 A 为格式 ...

  3. anglarjs概述

    anglarjs 是一个MVC框架,是开发单页面应用的上上之选,它不是一个功能库,是一个开发动态页面的html框架.专注于扩展html功能,提供动态数据绑定,并能够与jquery合作融洽. 要定义一个 ...

  4. HTML canvas图像裁剪

    canvas drawImage方法的图像裁剪理解可能会比较耗时,记录一下,以便供人翻阅! context.drawImage(img,sx,sy,swidth,sheight,x,y,width,h ...

  5. C++中Map常见用法以及按照value排序

    今天做一个简单的算法题,居然用了1个小时,STL unordered_map用多了,没想到map这次派上了用场,这里记录一下: 算法题为 给一个字符串例如  abaaba,每连续两个字符组成一个子串 ...

  6. Tomcat下log4j设置文件路径和temp目录

    转自:http://www.cnblogs.com/dkblog/archive/2007/07/27/1980873.html 在Web应用中的如何设置日志文件的路径呢?最笨的方法是写绝对路径,但很 ...

  7. Hibernate3 第三天

    Hibernate3 第三天 第一天:三个准备.七个步骤 第二天:一级缓存.快照.多对多和一对多的配置 学习内容: Hibernate的查询详解(各种检索(fetch)对象的方式) 1)条件查询分类( ...

  8. git切换分支

    今天同事问我她的报错了,我看了一下,是分支没有指向远程仓库对应的分支;报错如下; $ git pull There is no tracking information for the current ...

  9. C#的面向对象

    一.面向对象编程(OOP)是将现实中的事物抽象花,其设计的重点就是类的设计. 二.类是面向对象编程的设计核心,实际上是一种复杂的数据类型.将不同类型的数据和与这些数据就相关的操作封装在一起,就构成类. ...

  10. 关于wcf中一些重要词语解释

    From a distant view, the service offers an