In the home prediction jupyterbook, there is an issue with the correlation functions on my python environment.
## Describe your environment
VScode python .venv (python 3.10.4)
## Steps to Reproduce
Executing the code in LiL-homepredictions.ipynb returns an error when the housing_df.corr() function calls are made
Expected Behavior
We expect a correlation matrix to be produced
## Current Behavior
Instead an error appears saying that it cannot convert the ocean proximity values to a float.
## Possible Solution
It appears that columns with objects are not ignored by this function call. To solve this problem I simply selected only the columns that had no objects in:
corr = housing_df[columns_list].corr()
And in the second correlation matrix after feature engineering:
no_obj = [col for col in housing_df.columns if housing_df[col].dtype != 'object']
corr = housing_df[no_obj].corr()
## Screenshots / Video
N/A
## Related Issues
N/A
Issue Overview
In the home prediction jupyterbook, there is an issue with the correlation functions on my python environment. ## Describe your environment VScode python .venv (python 3.10.4) ## Steps to ReproduceExpected Behavior
We expect a correlation matrix to be produced ## Current Behavior Instead an error appears saying that it cannot convert the ocean proximity values to a float. ## Possible Solution It appears that columns with objects are not ignored by this function call. To solve this problem I simply selected only the columns that had no objects in: corr = housing_df[columns_list].corr() And in the second correlation matrix after feature engineering: no_obj = [col for col in housing_df.columns if housing_df[col].dtype != 'object'] corr = housing_df[no_obj].corr() ## Screenshots / Video N/A ## Related Issues N/A