Python Error ValueError: Input contains NaN, infinity or a value too large for dtype('float64')

Question:

can i know why im getting this error?
Error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’).

File "D:bipinjaman.py", line 64, in <module>
    prediksi = load_model.predict(df)

Code : https://drive.google.com/file/d/12O3JS1xOLgQnYHZ3w_5ko56QpUN5bkM6/view?usp=share_link

Asked By: Sviryu

||

Answers:

This error occurred by NaN value is exist in your data or exceed range of data type.

Add this code in pinjaman.py’s 63 row.
You can see how many NaN values in your data.

print(df.isnull().sum())

enter image description here

This is result of that code.
‘Penghasilan’ and ‘Jumlah’ column has NaN value.

Answered By: LinuxPenguin99
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.