import numpy as np
x=np.array([5,5])
y=np.array([2,2])
乘法javascript
np.multiply(x,y)
np.dot(x,y)#內積
x.shape
y.shape
x.shape=2,1
x
np.dot(x,y)#維度不同
y.shape=1,2
y
x
print(x.shape)
print(y.shape)
np.dot(x,y)
np.dot(y,x)
x=np.array([1,1,1])
y=np.array([[1,2,3],[4,5,6]])
print(x*y)#自動加維數轉換
x=np.array([1,1,1])
y=np.array([1,1,1])
x==y#必須維度同樣,逐一進行比較
np.logical_and(x,y)#邏輯與操做
np.logical_or(x,y)#或
np.logical_not(x,y)#非