Код: Выделить всё
import numpy as np
x = np.arange(25).reshape(5, 5)
print(x.base)
y = x[:2, [0, 2]]
print(y.base)
Код: Выделить всё
[ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
24]
[[0 5]
[2 7]]
Подробнее здесь: https://stackoverflow.com/questions/792 ... d-indexing
Мобильная версия