0
0
NumPydata~5 mins

Normal distribution with normal() in NumPy - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the numpy.random.normal() function do?
It generates random numbers that follow a normal (bell-shaped) distribution, centered around a mean value with a given spread (standard deviation).
Click to reveal answer
beginner
What are the main parameters of numpy.random.normal()?
The main parameters are loc (mean), scale (standard deviation), and size (number of values to generate).
Click to reveal answer
beginner
Why is the standard deviation important in a normal distribution?
Standard deviation controls how spread out the numbers are around the mean. A small value means numbers are close to the mean; a large value means they are more spread out.
Click to reveal answer
beginner
How can you generate 1000 random numbers with mean 10 and standard deviation 2 using numpy?
Use numpy.random.normal(loc=10, scale=2, size=1000) to get 1000 numbers centered at 10 with spread 2.
Click to reveal answer
intermediate
What shape of data does numpy.random.normal() return when size is a tuple?
It returns a NumPy array with the shape given by the tuple, filled with random numbers from the normal distribution.
Click to reveal answer
What does the loc parameter in numpy.random.normal() specify?
AThe number of samples to generate
BThe mean of the distribution
CThe standard deviation of the distribution
DThe minimum value of the distribution
If you want to generate 500 random numbers from a normal distribution, which parameter controls this?
Aloc
Bscale
Csize
Dmean
What happens if you set scale=0 in numpy.random.normal()?
AYou get random numbers spread out widely
BYou get negative numbers only
CYou get an error
DYou get all numbers equal to the mean
Which shape will the output have if you use size=(3,4)?
AA 3 by 4 NumPy array
BA list of 12 numbers
CA single number
DA 4 by 3 NumPy array
Which of these is true about the normal distribution?
AIt is symmetric around the mean
BIt has no mean
CIt only produces positive numbers
DIt is always skewed to the right
Explain how to use numpy.random.normal() to simulate real-world data like heights or test scores.
Think about how average and spread describe real data.
You got /5 concepts.
    Describe the effect of changing the scale parameter on the shape of the data generated by numpy.random.normal().
    Consider what happens when spread increases or decreases.
    You got /4 concepts.