Please understand how the 2 lines below work. Although I understand the code, I can not write it intuitively.
1.How does a pair of parentheses create an array, then the individual elements go through the logical state check and create a new array.
2. How to package the filter elements in square brackets to create another sub-array
If it is difficult to explain it completely, do not hesitate to indicate additional reading material.
import numpy as np
my_vector = np.array ((- 17, 4, 0, 2, 21, 37, 105))
array((-17, 4, 0, 2, 21, 37, 105))
zero_mod_7_mask = 0 == (my_vector% 7) # First question refers to this line
array((False, False, True, False, True, False, True))
my_subarray = my_vector (zero_mod_7_mask) # Second question refers to this line
array(( 0, 21, 105))