intro-stat-learning / ISLP_labs

Up-to-date version of labs for ISLP
BSD 2-Clause "Simplified" License
769 stars 444 forks source link

Chapter 4 Classification Python Lab corr() numeric_only no longer supported? #24

Open davidqwerty opened 8 months ago

davidqwerty commented 8 months ago

When I run the code Smarket.corr(numeric_only=True) , I get the following warning: corr() got an unexpected keyword argument 'numeric_only'

There appears to be a solution:

Smarket = Smarket.select_dtypes(include='number')
Smarket.corr()

This appears to achieve the intended result.