ageron / ageron/handson-ml3

[BUG] DataFrame.corr() is not called correctly

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

Description

02_end_to_end_machine_learning_project.ipynb contains a bug in calls to DataFrame.corr(), eg the line

```
corr_matrix = housing.corr()
```

Should be

```
corr_matrix = housing.corr(numeric_only=True)
```

Running it on colab gives a warning, but it errors (without a useful error message) on a newer version of Pandas.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open 02_end_to_end_machine_learning_project.ipynb and find the housing DataFrame.corr() calls, including the shown corr_matrix assignment. Update the affected calls to pass numeric_only=True, then run the notebook in Colab or with a newer Pandas version and confirm the warning/error is gone.

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
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.