Skip to main content
Loading page…
Python Mastery
Chapter 40
Lesson 2 of 4
Indexing, Slicing & Vectorization
Contents
Notes
Tutor
Concept
Basic Indexing and Slicing — and the View vs Copy Distinction
Loading activity…
Previous
1 / 9
Continue
Contents
Notes
Discussion
Tutor
30 min
9 activities
0 of 9 done
In this lesson
1
Basic Indexing and Slicing — and the View vs Copy Distinction
2
Boolean Masking — Filter Without a Loop
3
Fancy Indexing and Vectorized Operations
4
Data Cleaning Pipeline with Boolean Masking
5
Vectorized Grade Letter Assignment
6
Views vs Copies
7
Vectorization Concepts Quiz
8
Gotcha: Using 'and'/'or' Instead of '&'/'|' on Arrays
9
Why Vectorize?
Objectives
Index and slice 1-D and 2-D arrays using integers and ranges
Distinguish between a view (slice) and a copy (fancy index / boolean mask)
Build and apply boolean masks to filter arrays
Use fancy indexing with integer arrays to reorder or select rows
Write vectorized element-wise expressions without explicit Python loops
Apply universal functions (ufuncs) and explain why they beat equivalent loops
Chapter 40 · NumPy: Fast Numerical Computing
The ndarray
Indexing, Slicing & Vectorization
Broadcasting & Aggregation
Linear Algebra & Random
Previous: The ndarray
Next: Broadcasting & Aggregation