0
$\begingroup$

With reference to the below screen, I received the error:

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

For reading purposes, i'm appending screen shot. Please advise where I have gone wrong. Thanks for your assistance.

My Code:

enter image description here

enter image description here enter image description here

$\endgroup$
1
  • 2
    $\begingroup$ It is often more helpful to post your code as markdown as opposed to as pictures. That way people can reproduce it to help solve your problem. $\endgroup$ Commented May 30, 2019 at 18:21

1 Answer 1

1
$\begingroup$

You have missing values in your DF (NaN) means no observations. You need to skip these values since linear regression cannot handle them. Looks like conversion of sqm failed. Check what the format is and try to get int or float from sqm column to avoid NaN.

If you want to skip NaNs read the docs: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.dropna.html

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.