Skip to content

Commit 2156ab2

Browse files
committed
simpler solution
1 parent 7cf9e08 commit 2156ab2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

episodes/05-creating-histograms.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,9 @@ mask[circle] = 1
410410

411411
# just for display:
412412
# make a copy of the image, call it masked_image, and
413-
# use np.logical_not() and indexing to apply the mask to it
414-
masked_img = wellplate[:]
415-
masked_img[np.logical_not(mask)] = 0
413+
# zero values where mask is False
414+
masked_img = np.array(wellplate)
415+
masked_img[mask == False] = 0
416416

417417
# create a new figure and display masked_img, to verify the
418418
# validity of your mask

0 commit comments

Comments
 (0)