dlab-berkeley / Python-Machine-Learning

D-Lab's 6 hour introduction to machine learning in Python. Learn how to perform classification, regression, clustering, and do model selection using scikit-learn in Python.
Other
80 stars 68 forks source link

01_regression.ipynb Correlation #59

Open surajrn opened 1 year ago

surajrn commented 1 year ago

When using Pandas version > 2, the correlation code requires an additional argument.

Running data.corr() might give an error which looks like this:

ValueError: could not convert string to float: 'chevrolet chevelle malibu'

Need to change the code snippet to:

data.corr(numeric_only=True)