I have a 2D NumPy array aand a list / set / 1D NumPy array b. I would like to find those lines athat contain any of b, i.e.
import numpy as np
a = np.array([
[1, 2, 3],
[4, 5, 3],
[0, 1, 0]
])
b = np.array([1, 2])
# result: [True, False, True]
Any clues?
source
share