SchoolWhool
Quizzes and saved progress, freeSign in freeSign in

Tools 1.3Lesson outlineLesson 3 of 7 in Module 1

Indexing, Slicing and Masks

Select exactly the elements you want, including by condition.

Free sample. Everything in this module opens with a free account.Video in production.

Lesson outline: Indexing, Slicing and Masks

In this lesson10 parts

  1. 01The two questions: which days beat the target, and what the chain took
  2. 02Selecting with a Python loop and an if, and what it loses
  3. 03Indexing one element: arr[i], negative positions and arr[row, col]
  4. 04Slices: arr[start:stop], the step, and a whole row or column
  5. 05A slice is a view, not a copy: shares_memory and copy
  6. 06Comparing a whole array, and the boolean array it returns
  7. 07Boolean masks: selecting, counting with sum, and assigning
  8. 08Combining conditions with &, | and ~, and why `and` fails
  9. 09Fancy indexing: a list of positions, reordered, and a copy
  10. 10Recap and your challenge