DEV Community

Jaweher Ben Salah
Jaweher Ben Salah

Posted on

Answer: sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype('float64')

None of the answers here worked for me. This was what worked.

Test_y = np.nan_to_num(Test_y)

It replaces the infinity values with high finite values and the nan values with numbers

Top comments (0)