第2个回答 2022-10-14
from numpy import *
def creat_array_0(n, m):
# 生成一个n*m的零矩阵
matrixA = [None] * n
for i in range(n):
newaxis =[]
for j in range(m):
newaxis.append(random.randint(1,101))
matrixA[i] = newaxis
matrixB = array(matrixA)
return matrixB
if __name__ == '__main__':
print(creat_array_0(8,5))