I am trying to return an array that takes m, rows, of n, a random integer n, however, I am not sure how to do this. Do I need to set m = to random user input? And n = random integer 0-99. This is the code I have however, instead of me telling the array to be 6 rows of 7 random numbers how do I replace it with m and n and have it work using a random number of rows and integers?
import numpy as np
def gen_matrix(m,n):
m=
return np.random.rand(6,7)*100
random_matrix = numpy.random.randint(0,max_val,
(<num_rows>,<num_cols>))
Aucun commentaire:
Enregistrer un commentaire