Python is the definitive language for data science in 2026. From pandas for data manipulation to scikit-learn for ML, PyTorch for deep learning, and Polars for high-performance analytics — the ecosystem has never been stronger. This roadmap takes you from Python beginner to data scientist.
📋 Table of Contents
The Data Science Learning Path
Phase 1: Python Foundations (Months 1-2)
Before diving into data science, master Python fundamentals:
- Variables, data types, control flow
- Functions, classes, file I/O
- List comprehensions and generators
- NumPy arrays (the foundation of all data science)
import numpy as np
# NumPy is the foundation
arr = np.array([1, 2, 3, 4, 5])
print(arr * 2) # [2, 4, 6, 8, 10]
print(arr.mean()) # 3.0
print(arr.std()) # 1.41...
# Matrix operations
matrix = np.random.randn(5, 5)
print(matrix.shape) # (5, 5)
print(matrix.sum(axis=0)) # column sums
Phase 2: Data Analysis with Pandas (Month 3)
import pandas as pd
# Load and explore
df = pd.read_csv("sales.csv")
print(df.shape) # (rows, columns)
print(df.dtypes) # column types
print(df.describe()) # statistics
print(df.isnull().sum()) # missing values
# Clean
df = df.dropna(subset=['price']) # drop rows with missing price
df['date'] = pd.to_datetime(df['date'])
df['category'] = df['category'].str.strip().str.lower()
# Analyze
monthly = df.groupby(df['date'].dt.month)['revenue'].sum()
top_products = df.groupby('product')['quantity'].sum().sort_values(ascending=False).head(10)
# Merge datasets
customers = pd.read_csv("customers.csv")
merged = df.merge(customers, on='customer_id', how='left')
Phase 3: Data Visualization (Month 4)
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as px
# Publication-quality static charts (Matplotlib/Seaborn)
fig, axes = plt.subplots(2, 2, figsize=(12, 8))
axes[0,0].hist(df['revenue'], bins=30, color='steelblue')
axes[0,0].set_title('Revenue Distribution')
sns.boxplot(data=df, x='category', y='revenue', ax=axes[0,1])
plt.tight_layout()
plt.savefig('analysis.png', dpi=300)
# Interactive charts (Plotly)
fig = px.scatter(df, x='marketing_spend', y='revenue',
color='category', size='quantity',
hover_name='product', trendline='ols')
fig.show() # opens in browser
Phase 4: Machine Learning with Scikit-learn (Months 5-6)
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor
from sklearn.metrics import mean_absolute_error, r2_score
import joblib
# Prepare data
X = df[['marketing_spend', 'season', 'product_category', 'competitor_price']]
y = df['revenue']
# Encode categoricals
X = pd.get_dummies(X, columns=['season', 'product_category'])
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)
# Train and evaluate multiple models
models = {
'Random Forest': RandomForestRegressor(n_estimators=200, random_state=42),
'Gradient Boosting': GradientBoostingRegressor(n_estimators=200, random_state=42),
}
for name, model in models.items():
model.fit(X_train_scaled, y_train)
y_pred = model.predict(X_test_scaled)
mae = mean_absolute_error(y_test, y_pred)
r2 = r2_score(y_test, y_pred)
cv = cross_val_score(model, X_train_scaled, y_train, cv=5, scoring='r2')
print(f"{name}: MAE={mae:.0f}, R2={r2:.3f}, CV={cv.mean():.3f}±{cv.std():.3f}")
# Save best model
joblib.dump(models['Random Forest'], 'revenue_model.joblib')
Phase 5: Deep Learning (Months 7-8)
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, TensorDataset
# Simple neural network for tabular data
class SalesNet(nn.Module):
def __init__(self, input_dim: int):
super().__init__()
self.net = nn.Sequential(
nn.Linear(input_dim, 256),
nn.ReLU(),
nn.Dropout(0.3),
nn.Linear(256, 128),
nn.ReLU(),
nn.Dropout(0.2),
nn.Linear(128, 1),
)
def forward(self, x):
return self.net(x).squeeze()
# Training loop
model = SalesNet(input_dim=X_train.shape[1])
optimizer = torch.optim.Adam(model.parameters(), lr=1e-3)
criterion = nn.MSELoss()
for epoch in range(100):
model.train()
optimizer.zero_grad()
preds = model(X_tensor)
loss = criterion(preds, y_tensor)
loss.backward()
optimizer.step()
Phase 6: Production & MLOps (Months 9-10)
- FastAPI — serve ML models as REST APIs
- MLflow — experiment tracking, model registry
- Docker — containerize ML applications
- GitHub Actions — automated retraining pipelines
- Streamlit — rapid ML dashboard creation
Essential Libraries by Category
| Category | Libraries |
|---|---|
| Data manipulation | pandas, polars (faster), numpy |
| Visualization | matplotlib, seaborn, plotly |
| Classical ML | scikit-learn, xgboost, lightgbm |
| Deep learning | PyTorch, TensorFlow/Keras |
| NLP/LLMs | transformers, spaCy, langchain |
| Notebooks | Jupyter, Google Colab (free GPU) |
Data Science Jobs in 2026
- Data Analyst ($70k-120k): SQL + Python + visualization
- Data Scientist ($100k-170k): ML modeling + statistics
- ML Engineer ($120k-220k): Production ML systems
- AI Engineer ($150k-300k): LLMs, RAG, agents
Python data science in 2026 leads to some of the highest-paying tech roles. Start with pandas and scikit-learn for immediate job readiness, add deep learning with PyTorch when ready to specialize. The AI Engineer role — building LLM-powered applications — is the fastest-growing and highest-paying path, and it builds directly on the data science foundation.
📚 You might also like
🔗 Share this article




✍️ Leave a Comment