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]
ββ run Β· ββ β nav
βΆ Output
Run your code to see output here.