Feature engineering for machine learning

Code snippets and examples of how to prepare your data for machine learning modelling and data science projects

Feature encoding for machine learning

Label encode multiple columns in a Pandas DataFrame
Label encode unseen values in a Pandas DataFrame
One hot encoding vs label encoding, which is best?

Feature scaling for machine learning

Scale multiple columns in a Pandas DataFrame

Data cleaning in Pandas

Remove outliers from Pandas DataFrame

Groupby operations

Pandas groupby aggregate functions
Pandas groupby column and sum another column

Selecting and changing values in Pandas

Pandas loc vs iloc, what's the difference?
Set value for multiple rows in Pandas DataFrame
Divide two columns in Pandas DataFrame