FAQ: Statistical Distributions with NumPy - Standard Deviations and Normal Distribution, Part II


This community-built FAQ covers the “Standard Deviations and Normal Distribution, Part II” exercise from the lesson “Statistical Distributions with NumPy”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Data Science

Introduction to Statistics with NumPy

FAQs on the exercise Standard Deviations and Normal Distribution, Part II

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


Need a help with below things

Q. The average score on the SATs is 1000 and the standard deviation is 100.
2000 students took the exam. How many would you expect to have scores within the range of one_above and one_below ?

Save your response to the variable one_std and print it to the terminal.

My Code :

import numpy as np

one_above = 1000 + 100
one_below = 1000 -100

print(one_above, one_below)

one_std = np.random.normal(1000,100,2000)

expected_std= one_std[(one_std > one_below) | (one_std< one_above)]

count = 0

for x in expected_std :
count = count + 1
#print(one_std[(one_std > one_below) | (one_std< one_above)])

Query : But I am getting count as 2000 which is wrong , please help with the correct logic