handson-ml3
handson-ml3 copied to clipboard
[IDEA] Ch. 2: DataFrame.corr update
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 thank you
good find 👍