# 导包 import numpy as np Fancy Indexing 应用在一维数组 x = np.arange(16) x[3] x[3:9] # array([3, 4, 5, 6, 7, 8]) x[3:9:2] # array([3, 5, 7]) [x[3], x[5], x[7]] # [3, 5, 7] ind = [3, 5, 7] x[ind] # array([3, 5, 7]) ind = np.array([[0, 2], [1, 3]]) x[ind] "&qu…