Given a 1d np.ndarray containing a list of indexes that is True: [1, 2, 4], and length of the target np.ndarray: 6
How can we quickly construct the actual np.ndarray which should be [False, True, True, False, True, False]
idx = [1,2,3]
s = 6
a = np.zeros(s,dtype=bool)
a[idx] = True
output:
[False True True True False False]