import numpy as np a = np.array([[1,2,3,4,5],[6,7,8,9,10]]) b = a[a>6] # 截取矩阵a中大于6的元素,返回的是一维数组 print(b) # 返回[ 7 8 9 10] # 其实布尔语句 ...
確定! 回上一頁