handson-ml3 icon indicating copy to clipboard operation
handson-ml3 copied to clipboard

[IDEA] Ch. 2: DataFrame.corr update

Open hgato opened this issue 1 year ago • 1 comments

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!

hgato avatar May 30 '23 16:05 hgato

@hgato thank you

good find 👍

oxbits avatar Sep 11 '23 00:09 oxbits