81.8k views
3 votes
Generate an array x that has n=100 random numbers that are uniformly distributed over the interval [0,1) . Look up how to use the uniform() submodule of numpy.random for this question.

User Deathtiny
by
5.7k points

1 Answer

4 votes

Answer: np​.​random​.​uniform​(​0,​1,​100)

Step-by-step explanation:

import numpy as np

#pass the random uniform generated array into x

x = np.random.uniform(low, high, size)

#here low = 0, high = 1, size = 100

x = no.random.uniform(0,1,100)

User Ajeet Ganga
by
5.1k points