ageron / ageron/handson-ml3

[IDEA] Ch. 2: DataFrame.corr update

Open
#80 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
14.2k
Forks
5.3k
PR merge metrics
No merged PRs in 30d

Description

Good day!

File https://github.com/ageron/handson-ml3/blob/main/02_end_to_end_machine_learning_project.ipynb
In [35]:
Line: `corr_matrix = housing.corr()`

In the latest version of Pandas (2.0.2) attribute numeric_only of `corr()` method is defaulted to False. This causes an issue:
```ValueError: could not convert string to float: 'NEAR BAY'```

I suggest adding a comment about this issue and possible solution in the comment section). Alternatively you can default the value manually. For me code `corr_matrix = housing.corr(numeric_only=True)` works just fine.

Thank you!

Contributor guide

No contributing guide indexed for this repository

Research direction

Open 02_end_to_end_machine_learning_project.ipynb and inspect cell In [35], where housing.corr() raises the reported ValueError with Pandas 2.0.2. Run the surrounding notebook cells to reproduce the failure, then verify that the correlation matrix is computed successfully without attempting to convert the string-valued ocean_proximity column.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, pandas, python
Domain
data, machine-learning
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.