Open rejgrant opened 8 months ago
Try this:- housing_encoded = pd.get_dummies(housing, columns=['INLAND'], drop_first=True) corr_matrix = housing_encoded.corr()
TRY THIS WAY
housing_encoded = pd.get_dummies(housing, columns=['ocean_proximity'], drop_first=True) corr_matrix = housing_encoded.corr() corr_matrix["median_house_value"].sort_values(ascending=False)
I am getting the following error while using corr_matrix = housing.corr(), I know the method should exclude non-numerical columns, can't understand this error. " ValueError: could not convert string to float: 'INLAND' "