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 396 forks source link

Fix pandas future warning for dropping invariants #334

Closed jona-sassenhagen closed 2 years ago

jona-sassenhagen commented 2 years ago

When I use drop_invariant=True, I get a FutureWarning because df.drop is switching to named kwargs only. This fixes it.

It should also be substantially more performant as the DF is only modified once.

jona-sassenhagen commented 2 years ago

@janmotl any chance you can review this?

janmotl commented 2 years ago

@jona-sassenhagen Can you confirm that the new call also works in the oldest version of Pandas that category_encoders claim to support? If yes, I do not see a reason why the PR should not be merged.

However, I am not active in the project anymore and the merge must be done by some of the current maintainers. @zachmayer ?

jona-sassenhagen commented 2 years ago

Yes, the new call should work, there was no change to inplace since .21: https://pandas.pydata.org/pandas-docs/version/0.21/generated/pandas.DataFrame.drop.html

Who are the current maintainers? I don't want to randomly ping people. Zach isn't a maintainer I'm pretty sure :)

Thanks!

janmotl commented 2 years ago

@jona-sassenhagen I don't know.

PaulWestenthanner commented 2 years ago

Hi Jona, thanks for your contribution. I'm one of the maintainers. I'm sorry it always takes some time until one of us reviews stuff.
The PR looks good to me and I'll merge it when the pipeline succeeds.

PaulWestenthanner commented 2 years ago

It seems like our github runner instance does not support Python 3.5 anymore. So the problem seems to be on our side, not on yours. I thinks we should deprecate python 3.5 anyways since it ran out of the 5 year support period. Please bear with me with this issue.

jona-sassenhagen commented 2 years ago

Sure no worries. Thanks a lot.

PaulWestenthanner commented 2 years ago

@jona-sassenhagen I've updated the pipeline. Can you please pull the latest master so that I can run the checks again?

jona-sassenhagen commented 2 years ago

@PaulWestenthanner like this?

jona-sassenhagen commented 2 years ago

🙏