-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] [Chapter2] ValueError when calculating the correlations in corr_matrix = housing.corr() #614
Comments
I got the same problem too.
Problem I got below
|
same with you guys. |
In new version of python, |
I got the same issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following ValueError occurs when calling
corr_matrix = housing.corr()
ValueError: could not convert string to float: 'INLAND'
Obviously the DataFrame gets confused by the values in "ocean_proximity"
For me the solution was to change the 2 lines were the correlations are calculated to:
corr_matrix = housing.corr(numeric_only=True)
According to:
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.corr.html
The default value of numeric_only for DataFrame.corr() was changed to False effective as of pandas 2.0.0
The text was updated successfully, but these errors were encountered: