Masking Lab

The cardboard mask

A mask is a piece of cardboard with holes. True cuts a hole, False leaves the cardboard. You can only read, or write, through the holes.

Choose an array and a mask

Use > < == !=, & | ~, %, and np.any(…, axis=) / np.all(…, axis=) for row and column masks.

Step 1 — The original array

  1. 1 · Array
  2. 2 · Cardboard
  3. 3 · Read or write

The Boolean mask

Press any cell to switch it between True and False.

Transcript