>>> a = np.array([2, 3, 5, 7]) >>> a[0, 2, 3] Traceback (most recent call last): File "<stdin>", line 1, in <module> IndexError: too many indices for array
はできませんが >>> a[[0, 2, 3]] array([2, 5, 7])
はできます。 (edited)>>> a[[0, 2:4]] File "<stdin>", line 1 a[[0, 2:4]] ^ SyntaxError: invalid syntax