=== 求模运算 ===
scores = np.array([[19,29,35],[39,27,14],[0,2,7]])
print(scores)
np.mod(scores,10)
[[19 29 35] [39 27 14] [ 0 2 7]]
array([[9, 9, 5], [9, 7, 4], [0, 2, 7]], dtype=int32)
== 两个数组点积 dot ==
矩阵积
np.dot(arr1,arr2)
== 数组内元素比大小 ==
np.greater(arr1,arr2)
arr1 > arr2
np.less(arr1,arr2)
arr1 < arr2
np.equal(arr1,arr2)
arr1 == arr2
=数组元素的布尔逻辑运算=
与&、或| 、异或^(一真一假得真)
0^1=1; 1^1=0; 0^0=0; 1^0=1;
np.logical_and(arr1,arr2)
arr1 & arr2
np.logical_or(arr1,arr2)
arr1 | arr2
np.logical_xor(arr1,arr2)
arr1^arr2
== 元素指数运算 ==
每个元素的三次方
np.power(arr,3)
arr**3

二元函数

编码