numpy.take — NumPy v1.24 Manual
https://numpy.org/doc/stable/reference/generated/numpy.take.htmlVerkkoExamples. >>> a = [4, 3, 5, 7, 6, 8] >>> indices = [0, 1, 4] >>> np.take(a, indices) array ( [4, 3, 6]) In this example if a is an ndarray, “fancy” indexing can be used. >>> a = np.array(a) …