例题2.32

例题2.32代码

import numpy as np

a = np.ones(4)
b = np.arange(2, 10, 2)
c = a @ b  #a作为行向量,b作为列向量
d = np.arange(16).reshape(4,4)
f = a @ d  #a作为行向量
g = d @ a  #a作为列向量
print(a), print(b), print(c), print(d), print(f),print(g)


posted @ 2024-10-22 22:02  等我刷把宗师  阅读(2)  评论(0编辑  收藏  举报