[code] import numpy as np # 创建随机交换的索引 permutation = list(np.random.permutation(3)) # 创建矩阵X,Y X = np.array([[0, 1, 2], [0, 1, 2], [0, 1, 2]]) Y = np.array([[0, 1, 2]]) # 交换顺序 shuffled_X = X[:, permutation] shuffled_Y = Y[:, permutation] # 输出 print("pe…