0 / 34
Lesson 5

Basic Indexing

Zero-based, negatives from end:

a = np.array([10, 20, 30, 40, 50])
a[0]   # 10
a[-1]  # 50
a[1:4] # [20, 30, 40]
Why this matters

Indexing is how you select data without copying the whole arrayβ€”table filters, image crops, and time windows all start here.

Slices like 1:4 are often views: fast, but shared memory until you .copy().

ResourcesDocs, references & more β€” opens in a new tab
🎯 Your Task

Given data = np.arange(10, 110, 10), create middle with index 3-6 (inclusive).

data[3:7]
exercise.py
⌘⏎ run Β· βŒ˜β† β†’ nav
β–Ά Output
Run your code to see output here.