标签:let cal rac env letter digg rect apply ken
import numpy as np
x=np.array([5,5])
y=np.array([2,2])
乘法
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)#非
标签:let cal rac env letter digg rect apply ken
原文地址:https://www.cnblogs.com/AI-robort/p/11627176.html