Questions tagged «valueerror»

13
sklearn错误ValueError:输入包含NaN,无穷大或对于dtype('float64')而言太大的值
我正在使用sklearn,并且亲和力传播存在问题。我建立了一个输入矩阵,并且不断收到以下错误。 ValueError: Input contains NaN, infinity or a value too large for dtype('float64'). 我跑了 np.isnan(mat.any()) #and gets False np.isfinite(mat.all()) #and gets True 我尝试使用 mat[np.isfinite(mat) == True] = 0 删除无限值,但这也不起作用。我该怎么做才能摆脱矩阵中的无限值,以便可以使用亲和力传播算法? 我正在使用anaconda和python 2.7.9。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.