Generate Random Numbers From The Uniform Distribution using NumPy
Random numbers are the numbers that cannot be predicted logically and in Numpy we are provided with the module called random module that allows us to work with random numbers. To generate random numbers from the Uniform distribution we will use random.uniform() method of random module.
numpy.random.uniform(low = 0.0, high = 1.0, size = None)
In uniform distribution samples are uniformly distributed over the half-open interval [low, high) it includes low but excludes high interval.
numpy as np
[0.3829765 0.50958636 0.42844207 0.4260992 0.3513896 ]
numpy as np
"1D Array with random values : \n"
1D Array with random values :
[0.2167103 0.07881761 0.89666672 0.31143605 0.31481039]
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses
are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!