码迷,mamicode.com
首页 > 编程语言 > 详细

使用python中出现的错误统计

时间:2018-05-22 22:11:10      阅读:1904      评论:0      收藏:0      [点我收藏+]

标签:ack   data   The   cal   机器学习实战   not   opera   inpu   call   

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中出现的错误统计

标签:ack   data   The   cal   机器学习实战   not   opera   inpu   call   

原文地址:https://www.cnblogs.com/Aaron12/p/9073930.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!