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.39k stars 393 forks source link

Pandas lints #426

Closed s-banach closed 9 months ago

s-banach commented 10 months 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 9 months 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!