Introduction to NumPy
Learn to build, slice, filter and reshape NumPy arrays, run vectorized math with broadcasting, and transform image data through interactive exercises.
NumPy arrays store numerical data more compactly than Python lists and are faster to read and write, which is why Python’s data scientists and analysts depend on them. You build arrays of set shapes and data types, pick out values with slicing and masks, and calculate over whole arrays at once with vectorization and broadcasting. Practice data includes New York City’s tree census, store sales figures and the pixel values of a Claude Monet painting, which you flip, split and stack again.
What You Will Achieve
- Build arrays of a required shape and data type with lists, np.zeros, np.arange or random values
- Pull the rows, columns or records that meet a condition out of a two-dimensional dataset
- Calculate totals, averages and cumulative sales figures over an array, and combine arrays of different sizes in one operation
- Take an RGB image apart, rebuild an altered version of it and save the result as a .npy file
Program Overview
NumPy Array Creation, Shapes and Data Types
Shows how arrays differ from Python lists and how to build them, change their shape and choose the data type each one holds.
- Converting lists and creating arrays from scratch
- Range arrays and 3D arrays
- Flattening and reshaping
- NumPy data types and the dtype argument
Selecting, Filtering and Updating Array Data
Uses New York City tree census data to slice, sort and filter arrays, and to add or remove data along any axis.
- Indexing and slicing in one and two dimensions
- Sorting and filtering with masks
- Fancy indexing vs. np.where()
- Shape compatibility, adding rows and columns, and np.delete()
Vectorized Math, Broadcasting and Image Transformations
Summarizes store sales with vectorized operations and broadcasting, then edits the RGB array of a Monet painting.
- Summary statistics and vectorized Python functions
- Broadcasting across rows and columns
- Loading and saving .npy files
- Flipping, transposing, splitting and stacking RGB data
Certificate Awarded (Paid)
Job Outlook
NumPy arrays underpin much of Python’s data analysis and machine learning work, so these skills apply in analyst and data science roles that handle numerical tables or image data.
Good for: Aspiring data analysts and data scientists who want to handle numerical and image data with NumPy arrays instead of plain Python lists.
Keep in mind: Every chapter works on a prepared dataset, such as tree census records or a painting’s RGB values, so applying the methods to your own files is left to you.
Bottom line: A practical NumPy course built on real datasets, closing with a chapter that edits a Monet painting as a 3D array.
Frequently Asked Questions
Which datasets do the exercises use?
Selection, sorting and filtering are practiced on New York City's tree census. The math chapter summarizes sales data for liquor stores, restaurants and department stores, and the last chapter works on image data taken from a Claude Monet painting.
Why does the course end with a painting?
The final chapter treats the Monet image as a three-dimensional array of RGB values. Flipping, transposing, splitting and restacking it show the kind of changes used to augment image data, which the course links to machine learning work.
What is broadcasting in NumPy?
Broadcasting lets NumPy run a mathematical operation between arrays of different sizes when their shapes are compatible. The lessons have you judge whether two shapes can broadcast, then apply it across the columns and across the rows of an array.
How are NumPy arrays different from Python lists?
NumPy arrays are n-dimensional and more compact in memory than lists, and reading or writing their items is faster. The opening chapter also shows how the data type an array holds contributes to the speed of array operations.
User Reviews
Write your review
You must be logged in to post a review.
Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.


There are no reviews yet.