
Explore a beginner-friendly guide to numpy basics, exploring ndarrays, indexing, slicing, random numbers, universal functions, linear algebra, statistics, and saving and loading arrays, with practical exercises in Google Colab.
Import numpy in google colab, compare python lists with numpy arrays, and observe fixed-length behavior and unique ids when appending elements, using version 1.26.4.
Learn how Python lists preserve multiple data types and how NumPy arrays convert to a single, homogeneous data type, using type inspection and common aliases between Python and NumPy.
Explore vectorization by converting lists to NumPy arrays and performing element-wise operations, revealing how array addition, subtraction, multiplication, division, modulo, and exponentiation differ from list concatenation and looping.
Explore broadcasting with numpy by comparing list-based addition to elementwise array operations, show how a 2x1 and a 1x4 array broadcast to 2x4, and highlight shape compatibility.
Tackle the first section homework using the provided Google Colab files, solve array exercises with NumPy append, and practice vectorization and broadcasting with add, subtract, multiply, and divide.
Explore numpy by creating arrays, appending elements, and inspecting ids to show fixed-size arrays and separate memory, then learn type conversion to float, vectorization, and broadcasting.
Create numpy arrays from lists, tuples, sets, and dictionaries, and inspect their types. Learn how each data structure affects array behavior, including object dtype with sets and dicts.
Create arrays with one and two dimensions, where a one-dimensional array is a vector and a two-dimensional array is a matrix. Access elements by row and column indices.
Learn how to create and access arrays with n dimensions in NumPy, forming matrices, vectors, and tensors, and inspect their shape, depth, rows, and columns.
Explore NumPy array attributes such as size, ndim, shape, dtype, itemsize, and nbytes to understand element counts, dimensions, and memory usage across 1d, 2d, and 3d arrays.
Create numpy arrays from data and verify their shape, dimensions, and size for 1d, 2d, and 3d arrays. Explore dtype conversions to float16, float32, string, and boolean.
Learn to create numpy arrays using zeros, ones, and full, specifying shapes like 2x3, exploring default float64 dtype, and using zeros_like, ones_like, and full_like to match existing arrays.
Explore three numpy array creators—np.empty, np.eye, and np.identity—showing how 2x3 and 5x5 or 5x3 shapes produce uninitialized memory values and diagonals of ones for linear algebra.
Learn to create arrays with numpy's arange, linspace, logspace, and geomspace by setting start, stop, and step or count, noting arange excludes upper bound and logspace uses powers of ten.
Learn indexing, slicing, and assigning in numpy by building and exploring a 3d array, understanding shape, depth, rows, and columns, and using masks to access elements.
Explore slicing of a 3d array to access specific depths, rows, and columns using index ranges, negative indices, and step sizes, with upper boundary exclusion and multiple equivalent forms.
Learn to assign values in a 3d numpy array by indexing elements and using slices. Change single elements, ranges, and entire matrices with position, row, and column specifications.
Explore how to work with 3d arrays in numpy by simulating athlete performance across days, runners, and laps, and master indexing, slicing, boolean masking, and in-place updates.
Explore conversion methods in numpy by turning arrays into lists, reshaping dimensions, and using indexing, item, and item set to access and modify values.
Explore NumPy shape manipulation methods, including reshape, transpose, swap axis, flatten, ravel, and squeeze, with practical examples of changing depth, rows, and columns.
Explore item selection and manipulation with numpy, using take, put, repeat, sort, argsort, searchsorted, and diagonal on 3d arrays to extract, modify, and order data.
Explore numpy array manipulation from indexing with item and itemset to view versus copy, reshape, transpose, swap axis, flatten, and sort across days, athletes, and laps.
Explore calculation methods in numpy by computing max and min across axes, preserving dimensions with keepdims, and locating indices with arg max and arg min on 2d arrays.
Explore numpy calculation methods, including ptp for peak to peak values and axis control. Apply clip to constrain values and round to decimals on 2d arrays.
Explore three NumPy functions—sum, cumulative sum, and min—applied to a 2d array, with axis handling and the total sum, then compute the mean and size.
Apply numpy calculation methods to a 2d array, computing variance and standard deviation along axes. Compute prod and cumulative prod while evaluating greater-than-zero conditions with all and any.
Explore numpy array operations on athlete lap data across days using max, argmax, min, argmin, axis, clip, round, sum, cumsum, mean, var, std, and boolean masks to analyze performance.
Explore generating random numbers with numpy's default_rng, using seed for reproducibility, and apply rng.random, rng.integers, and rng.choice on arrays and matrices with axis and probability weights.
Explore permutations with numpy by using rng.shuffle, rng.permutation, and rng.permuted to shuffle arrays and matrices, controlling row or column order with axis settings.
Explore how NumPy generates random data from beta, binomial, chi square, and exponential distributions, and visualize their shapes with histograms.
Explore and visualize four statistical distributions: gamma, logistic, normal, and uniform, by generating random samples, adjusting shape, scale, and size, and plotting histograms.
Learn to generate random data with numpy, create arrays and matrices, and visualize distributions with matplotlib. Practice sampling, shuffling, permutation, and explore beta, binomial, chi-square, exponential, normal, and uniform distributions.
Learn to group and split arrays in NumPy using concatenate, stack, vstack and hstack, and control the resulting shape with axis and indices or sections.
Learn to add new axes to NumPy arrays using expand_dims and newaxis, transforming a 2d array into 3d with axis 0 or 1, and revert with squeeze.
Learn to reorder array elements with numpy.flip for 1d and 2d arrays, using axis to reverse rows or columns, and compare resize and reshape.
Learn to add or remove elements in numpy arrays with insert, delete, and append, using 1d and 2d arrays, axis, tile, and pad, plus trimming zeros.
Explore numpy unique to obtain unique values, their indices, and counts for 1d, 2d, and 3d arrays, reconstructing arrays from indices and counting row and column appearances.
Explore practical numpy fundamentals by creating 2d arrays with arange and reshape, stacking and concatenating across axes, expanding dimensions, flipping, resizing, inserting and deleting elements, padding, and extracting unique values.
Identify nonzero elements with numpy nonzero in a 3x3 matrix, filter to values one to four, and use numpy where, dot, and argwhere for conditional transforms and index extraction.
Explore numpy indexing functions, including select with multiple conditions for 1d arrays, unravel_index to map numbers to matrix coordinates, and diagonal_indices to access and modify the main diagonal.
Practice numpy indexing by extracting the lower and upper triangle elements of a 3x3 matrix and comparing with diagonal indices, then visualize changes with simple array edits.
Demonstrates a numpy based homework solution: generate random arrays, filter nonzero values, replace zeros with nan, multiply by two. Compute pairwise distances with sklearn; visualize results.
Explore universal functions in NumPy and perform elementwise add, subtract, multiply, and divide on two arrays. Compare NumPy functions to Python operators, and learn mod, diff, and absolute operations.
Explore numpy's mathematical functions for arrays, including power, exponential, logarithm, reciprocal, sqrt, cbrt, gcd, and lcm with np.power, np.exp, np.log, np.reciprocal, np.sqrt, np.cbrt, np.gcd, and np.lcm.
Explore using NumPy trigonometric functions on arrays interpreted as radians, including sine, cosine, tangent, arcsin, arctangent, and hypotenuse, with practical examples.
Learn element-wise numpy comparisons between two arrays, using maximum, minimum, greater, less equal, and equal. Apply logical operations and tolerance checks with is close, all close, and array equal.
Explore numpy float functions, including handling division by zero to produce inf and -inf, nan checks with isnan, and applying floor, ceil, and trunc to a sample array.
Explore numpy basics by performing elementwise operations on two 3x2 arrays with universal functions, then apply math, trig, and boolean comparisons, including gcd, lcm, and allclose checks.
This course is designed for Python developers who want to explore the powerful features of the NumPy library. Through hands-on lessons, you will acquire the skills needed to work with multidimensional arrays, perform complex scientific calculations, and manipulate data efficiently.
We will cover the following topics:
ndarrays (the fundamental class of NumPy) and their attributes:
Create and manipulate multidimensional arrays with the `ndarray` class
Explore the essential attributes of `ndarrays`
Learn array indexing and slicing techniques, and value assignment
Understand the different ways to create populated arrays
ndarray methods:
Extract attributes and perform mathematical operations on arrays
Use `ndarray` methods to efficiently manipulate data
Array manipulation:
Use array manipulation functions to modify and transform data
Combine arrays in different ways to create more complex datasets
Learn how to transpose, reorder, and invert arrays
Explore advanced indexing techniques to extract specific information from arrays
Powerful NumPy functions for analysis:
Use linear algebra functions to solve systems of equations, compute inverse matrices, and more
Apply statistical functions to analyze data, calculate measures of central tendency and dispersion
Master NumPy universal functions to perform mathematical operations on arrays
And more:
Generate random numbers with different probability distributions
Discover useful NumPy constants for scientific calculations
Save and load arrays for data persistence
By the end of this course, you will confidently use the NumPy library for numerical analysis in Python, work efficiently with multidimensional arrays, perform complex scientific calculations on arrays with precision and speed, manipulate data efficiently to extract valuable insights, and integrate the NumPy library into your existing Python development projects. With over 7 hours of step-by-step videos and solved exercises at the end of each section!