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

Pandas iteritems deprecation warnings #378

Closed jerheff closed 1 year ago

jerheff commented 1 year ago

Expected Behavior

No noisy warnings from running pipelines containing these transformers.

Actual Behavior

Frequent warnings due to Pandas 1.5 deprecation: category_encoders/one_hot.py:145: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.

Steps to Reproduce the Problem

  1. Install pandas 1.5.1 and category_encoders 2.5.1
  2. Use the OneHotEncoder in a pipeline
  3. See the warnings on fit

Specifications

glevv commented 1 year ago

That's because iteritems method is in deprecation cycle. I think PolynomialWrapper also uses it.

Should be an easy and quick fix