Skip to content
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] ValueError when computing correlation matrix due to non-numeric data #638

Open
caitlon opened this issue Jun 8, 2024 · 2 comments

Comments

@caitlon
Copy link

caitlon commented Jun 8, 2024

When trying to compute the correlation matrix of the housing dataset, I encounter a ValueError. The problem occurs because there are non-numeric values in the dataset.

Screenshot 2024-06-08 at 22 05 55
@madicke12
Copy link

Before trying to compute the correlation matrix of the housing dataset try to make a copy of it without non numerical data and it will work

@csmimrankhan
Copy link

After pandas version 2.0 now you need to add numeric_only=True in the bracket to avoid the issue
corr_matrix = housing.corr(numeric_only=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants