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

Getting Error when doing Binary Encode #308

Closed kartik1611 closed 3 years ago

kartik1611 commented 3 years ago

Expected Behavior

image

Actual Behavior

Getting Error error.txt

Steps to Reproduce the Problem

import category_encoders as ce import pandas as pd

Create the Dataframe

data=pd.DataFrame({'City':['Delhi','Mumbai','Hyderabad','Chennai','Bangalore','Delhi','Hyderabad','Mumbai','Agra']})

Create object for binary encoding

encoder= ce.BinaryEncoder(cols=['city'],return_df=True)

Original Data

data.head()

Fit and Transform Data

data_encoded=encoder.fit_transform(data) data_encoded

Specifications