scikit-learn-contrib / category_encoders

A library of sklearn compatible categorical variable encoders
http://contrib.scikit-learn.org/category_encoders/
BSD 3-Clause "New" or "Revised" License
2.41k stars 395 forks source link

Pandas lints #426

Closed s-banach closed 1 year ago

s-banach commented 1 year ago

(On top of previous commit regarding inplace.)

Most of these changes are simply replacing .values with either .array or .to_numpy(). The reason .values is discouraged, is because it behaves somewhat inconsistently.

I've tried to be more explicit, and use .to_numpy() whenever the object really needs to be numpy type.

P.S. You can probably ignore these changes if you don't feel comfortable with them, I believe they mostly have no functional impact. The only real useful change is adding axis=0 to some instances of np.var() in the tests. They're going to change the default to axis=None in some future version of numpy, which make break those tests.

PaulWestenthanner commented 1 year ago

I like this PR! thanks a lot. The library is heavily reliant on pandas and hence it makes sense to follow best practices there!