標籤: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中出現的錯誤統計