1. Learn
  2. /
  3. Courses
  4. /
  5. Foundations of Inference in Python

Connected

Exercise

Drawing conclusions from samples

You've seen how random sampling can be used to choose a sample of data which is (hopefully!) representative of the population you are studying. You've also seen how bias in sampling procedure can result in conclusions that are suspect at best, and completely wrong at worst.

In this exercise you'll analyze the average closing price of the S&P 500. If you take two different samples of trading days and compute confidence intervals for each, should you expect to see the same result? It's time for you to dive in and see!

Instructions 1/3

undefined XP
    1
    2
    3
  • Randomly select 500 rows from btc_sp_df.
  • Use stats.norm.interval() to create a 95% confidence interval for Close_SP500 column of your sampled DataFrame.