np.square() 函数返回一个新数组,该数组的元素值为源数组元素的平方. 源阵列保持不变. 示例: import numpy as np a = np.array([[1, 2, 3], [4, 5, 6]]) b = np.square(a) print(a) print(b) np.linalg.norm() linalg = linear(线性) + algebra(代数), norm表示范数 x_norm = np.linalg.norm(x, ord=None, axis=Non…