Data Tools tutorials and worked examples
Work with NumPy arrays, pandas tables, visualizations and scikit-learn pipelines using checked examples.
Data visualization
Choose charts from the question, data and comparison.
Choose a chart for a dataset by naming the comparison
Create category, time-series and paired-observation charts from explicit data, and check how aggregation can hide the story.
tutorial · 4 min read
NumPy arrays
All on this topicUnderstand shape, memory and numerical operations with inspectable arrays.
NumPy broadcasting rules: align axes before adding arrays
Predict broadcast shapes from the right, normalize columns correctly and diagnose an accidental outer operation with checked arrays.
tutorial · 4 min readNumPy views vs copies: predict which array changes
Trace shared memory through slicing, advanced indexing and assignment, and set an explicit copy boundary in a numerical workflow.
troubleshooting · 4 min readNumPy projects for beginners: three array projects with complete code
Build three NumPy projects with complete Python code: summarise weekly sales, clean sensor readings and scale features. Understand shapes, masks and broadcasting.
project · 9 min read
pandas tables
All on this topicClean, combine and inspect tables while preserving their meaning.
pandas groupby aggregation vs transform: group rows or preserve them
Compute group totals and row-level shares from an explicit table, including missing keys and a zero-total group.
tutorial · 4 min readpandas loc vs iloc: labels, positions and safe assignment
Use a nonconsecutive integer index to expose label versus position selection, slicing endpoints and aligned assignment.
tutorial · 4 min readWhy a pandas merge duplicates rows: validate the keys first
Calculate a join's row count, reproduce many-to-many expansion, and use validate and indicator to enforce the intended table relationship.
troubleshooting · 4 min readThree pandas projects for beginners, with complete code and output
Build three pandas projects with complete Python code: clean orders, join product tables and calculate a daily trend. Check outputs and common data mistakes.
project · 9 min read
Modeling workflows
All on this topicConnect preparation, fitting and evaluation without crossing data boundaries.
scikit-learn fit, transform and predict: keep learned state inside training
Run an imputer-scaler-classifier pipeline, inspect fitted statistics and verify that prediction does not refit preprocessing on held-out data.
tutorial · 4 min readMachine learning code in Python: your first model in about 30 lines
A complete, runnable scikit-learn example: load a built-in dataset, split it, beat a baseline, fit a model and evaluate it, with every line explained.
tutorial · 8 min read