Data Science

Scaling and Normalization

Senior Data Analyst
May 4, 2026
5 min read

Why Scale?

If `age` ranges 0-100 and `income` ranges 0-1,000,000, the model will be biased toward income.

Standard Scaling (Z-Score)

from sklearn.preprocessing import StandardScaler

scaler = StandardScaler()

df[['age', 'income']] = scaler.fit_transform(df[['age', 'income']])

Min-Max Scaling (0-1)

from sklearn.preprocessing import MinMaxScaler

scaler = MinMaxScaler()

df[['age', 'income']] = scaler.fit_transform(df[['age', 'income']])

*Day 125: Introduction to Machine Learning.*

Ready to put your knowledge into practice?

Join SQL Mastery and learn through interactive exercises.