ageron / ageron/handson-ml3

[BUG] Chapter 2, Dataframe.corr raises an exception when using pandas 2.0.0

Open
#101 0 comments 0 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

As of Pandas version 2.0.0 Dataframe.corr breaks if there are non numeric columns.
The problem appears in a couple of cells. One in Section 2.2 and one in Section 2.3

**To Reproduce**

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

**Solution**

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

**Versions:**
- MacOSX 14.0
- Python: 3.11.6
- Scikit-Learn: 1.3.1
- Pandas 2.0.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.