import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder
clothes_data = {
'item':['shirt', 'shirt', 'shorts', 'shoes', 'shoes', 'pants'],
'size':['small', 'small', 'medium', 'large', 'large', 'medium'],
'cost':[10, 12, 20, 30, 25, 18]
}
clothes_df = pd.DataFrame(clothes_data)
clothes_df
le = LabelEncoder()
le.fit(clothes_df['size'])
print(le.classes_)
clothes_df['size_LE'] = le.transform(clothes_df['size'])
clothes_df
clothes_df.drop('size', axis=1)