NumPy
Fast math on whole grids of numbers. The engine under pandas and machine learning. 15 modules of 10 minutes each, with questions that check your answers in the browser.
Foundations
- 1. Why NumPy: arrays vs Python listsFreeMeet the array, the data structure behind pandas and machine learning, and see why it beats lists for numbers.
- 2. Creating arrays (array, arange, zeros, ones, linspace)FreeBuild arrays from lists, number ranges, evenly spaced points and filled grids, the starting point of every NumPy program.
- 3. Array attributes (shape, dtype, ndim)FreeRead an array's shape, size and element type, convert between types, and avoid silent overflow.
- 4. Indexing and slicingFreePick single values, ranges, rows, columns and sub-grids out of arrays, and change them in place.
- 5. Boolean and fancy indexingFreeFilter arrays with conditions, combine conditions safely, replace values that match, and pick elements by a list of positions.
Intermediate
- 6. Element-wise operations and broadcastingFreeCombine arrays of different shapes without loops, using NumPy's broadcasting rules and universal functions.
- 7. Aggregations (sum, mean, and the axis argument)FreeSummarise arrays as a whole, per row or per column, find where the maximum is, and handle missing values.
- 8. Reshaping, stacking, and splittingFreeChange an array's shape without changing its data, glue arrays together, and cut them into pieces.
- 9. Random numbers and seedsProGenerate reproducible random data, sample and shuffle, and use simulation to answer "what are the chances?" questions.
Advanced
- 10. Linear algebra basics (dot, matmul)ProCompute weighted sums, order totals and model predictions with the dot product and matrix multiplication.
- 11. Working with axes in multi-dimensional arraysProHandle 3-D data like stores × months × products, aggregate over several axes, and reorder dimensions.
- 12. Views vs copies (and why it matters)ProKnow when an array shares data with another, avoid functions that secretly change their input, and use in-place operations on purpose.
- 13. Vectorization: replacing loopsProA toolkit of patterns for turning Python loops into fast array operations, from if/else chains to group sums and nearest neighbours.
Expert
- 14. Structured arrays and dtypesProStore records with named fields of different types, load them from files, and work with dates and business days.
- 15. Performance and memory layout (contiguity)ProUnderstand how arrays sit in memory, why row order and strides affect speed, and how to avoid unnecessary copies and temporaries.
Track project
- NumPy Project: Toko Kita's pricing and planningProThree graded tasks with arrays and no loops. Price a promotion on every order line at once, compare three stores month by month with axes and broadcasting, and simulate a year of demand to see how often a product would run out.
Pro modules unlock with one payment of Rp 149.000, yours to keep.