You can download this code by clicking the button below.
This code is now available for download.
This function generates a random matrix of specified number of rows and columns using numpy.
Technology Stack : numpy
Code Type : Function
Code Difficulty : Intermediate
import random
from datetime import datetime
import numpy as np
def generate_random_matrix(rows, cols):
# This function generates a random matrix of given rows and columns using numpy.
return np.random.rand(rows, cols)