В текущей версии 1.18
:
In [13]: a[[[0,1]]]
/usr/local/bin/ipython3:1: FutureWarning: Using a non-tuple sequence
for multidimensional indexing is deprecated; use `arr[tuple(seq)]`
instead of `arr[seq]`. In the future this will be interpreted as an
array index, `arr[np.array(seq)]`, which will result either in an
error or a different result.
#!/usr/bin/python3
Out[13]:
array([[0, 1, 2],
[3, 4, 5]])
In [14]: a[np.array([[0,1]])]
Out[14]:
array([[[0, 1, 2],
[3, 4, 5]]])
In [15]: _.shape
Out[15]: (1, 2, 3)
Другими словами, предыдущие версии интерпретировали [13] как
In [16]: a[([0,1],)]
Out[16]:
array([[0, 1, 2],
[3, 4, 5]])
In [17]: _.shape
Out[17]: (2, 3)
In [18]: a[([[0,1]],)].shape
Out[18]: (1, 2, 3)
Numpy, медленно очищая индексирование крайние случаи, которые были в основном результатом слияния нескольких различных числовых c пакетов лет a go.
===
Ваш комментарий кейс в удобочитаемой форме:
In [19]: a[[0,1],[0,1]]
Out[19]: array([0, 4])
In [20]: a[[[0,1],[0,1]]]
/usr/local/bin/ipython3:1: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
#!/usr/bin/python3
Out[20]: array([0, 4])
In [21]: a[([0,1],[0,1])]
Out[21]: array([0, 4])
In [22]: a[[[[0,1],[0,1]]]]
/usr/local/bin/ipython3:1: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
#!/usr/bin/python3
Out[22]:
array([[[0, 1, 2],
[3, 4, 5]],
[[0, 1, 2],
[3, 4, 5]]])
In [23]: a[np.array([[[0,1],[0,1]]])]
Out[23]:
array([[[[0, 1, 2],
[3, 4, 5]],
[[0, 1, 2],
[3, 4, 5]]]])