import numpy as np
V=np.zeros((100,100))#创建初始矩阵##
print(V)
for i in range(0,100):
for j in range(0,100):
r1 = np.random.random()#给矩阵每一个元素赋予一个新元素
V[i][j]=r1
print(V)
结果如图所示
for row in range(25):
for col in range(25):
print(V[row*4:(row+1)*4,col*4:(col+1)*4])#进行矩阵遍历分块