例题2.26

例题2.26代码

import numpy as np
a = np.ones(4, dtype= int)
b = np.ones((4,), dtype= int)
c = np.ones((4,1))
d = np.zeros(4)
e = np.empty(3)
f = np.eye(3)
g = np.eye(3, k = 1)
h = np.zeros_like(a)
print(a);print(b);print(c);print(d);print(e);print(f);print(g);print(h)


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