zoukankan      html  css  js  c++  java
  • 使用python中出现的错误统计

    1, unsupported operand type(s) for /: 'map' and 'int'

    机器学习实战 PCA程序

    Traceback (most recent call last):
    
      File "<ipython-input-29-808c65c1265e>", line 1, in <module>
        lowDMat,reconMat=pca.pca(dataMat,1)
    
      File "I:pythonPCApca.py", line 15, in pca
        meanVals = mean(dataMat, axis=0)

    解决办法:

    2 ,TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

    Traceback (most recent call last):
    
      File "<ipython-input-17-945c872e5152>", line 1, in <module>
        dataMat=pca.replaceNanWithMean()
    
      File "I:pythonPCApca.py", line 59, in replaceNanWithMean
        meanVal = mean(datMat[nonzero(~isnan(datMat[:,i].A))[0],i])
    
    TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be 
    safely coerced to any supported types according to the casting rule ''safe''
  • 相关阅读:

    守护线程
    下载图片
    多线程
    self的作用
    设置项目地址环境
    对象 类
    ValueError: urls must start with a leading slash
    mock挡板接口开发
    K&R——第五章 指针与数组
  • 原文地址:https://www.cnblogs.com/Aaron12/p/9073930.html
Copyright © 2011-2022 走看看