Data Science, Machine Learning, Artificial Intelligence, Technology, Data Mining.
each category. Ideal for ordinal data where there’s an inherent order. from sklearn.preprocessing import LabelEncoder label_encoder = LabelEncoder() df['category_column'] = label_encoder.fit_transform(df['category_column']) One-Hot Encoding: Create new columns indicating the presence of each