使用python中出现的错误统计

Posted Aaron12

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用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:\python\PCA\pca.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:\python\PCA\pca.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‘‘

 


以上是关于使用python中出现的错误统计的主要内容,如果未能解决你的问题,请参考以下文章

调用 onCreateView() 之前出现“找不到片段 id 的视图”错误

python 如何统计dataframe中某一列数据中每个元素出现的次数

在片段java类中使用“this”和getLastSignedInAccount时出现错误[重复]

由于未找到 ID 错误的视图,列表片段未出现

连接MySQL出现错误:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)(代码片段

201671010432词频统计软件项目报告