例题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)