Learn

Now that we’ve found Q2, we can use that value to help us find Q1 and Q3. Recall our demo dataset:

[108,4,8,15,16,23,42][-108, 4, 8, 15, 16, 23, 42]

In this example, Q2 is 15. To find Q1, we take all of the data points smaller than Q2 and find the median of those points. In this case, the points smaller than Q2 are:

[108,4,8][-108, 4, 8]

The median of that smaller dataset is 4. That’s Q1!

To find Q3, do the same process using the points that are larger than Q2. We have the following points:

[16,23,42][16, 23, 42]

The median of those points is 23. That’s Q3! We now have three points that split the original dataset into groups of four equal sizes.

Instructions

1.

Find the first quartile of dataset_one and store it in a variable named dataset_one_q1.

2.

Find the third quartile of dataset_one and store it in a variable named dataset_one_q3.

3.

Find Q1 and Q3 of dataset_two. Store the values in variables named dataset_two_q1 and dataset_two_q3.

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?