import numpy as np a=np.eye(3) print(a) a=np.eye(4,k=1) print(a) a=np.eye(4,k=-1) print(a) a=np.eye(4,k=-3) print(a)