Recall & Review
beginner
What is a percentile in data analysis?
A percentile is a value below which a certain percentage of data falls. For example, the 25th percentile is the value below which 25% of the data lies.
Click to reveal answer
beginner
What does the function
np.percentile() do?np.percentile() calculates the value below which a given percentage of data in an array falls. It helps find specific percentiles like median (50th percentile) or quartiles.Click to reveal answer
beginner
How do you find the median of an array
arr using np.percentile()?Use
np.percentile(arr, 50). The 50th percentile is the median, the middle value of the data.Click to reveal answer
intermediate
What is the difference between the 25th and 75th percentiles?
The 25th percentile (Q1) is the value below which 25% of data falls, and the 75th percentile (Q3) is the value below which 75% of data falls. The difference between them is called the interquartile range (IQR), showing data spread.
Click to reveal answer
intermediate
How does
np.percentile() handle multi-dimensional arrays?np.percentile() can calculate percentiles along a specified axis using the axis parameter. This lets you find percentiles for rows or columns separately.Click to reveal answer
What does
np.percentile(arr, 90) return?✗ Incorrect
np.percentile(arr, 90) returns the 90th percentile, meaning 90% of data is below this value.Which percentile corresponds to the median?
✗ Incorrect
The median is the 50th percentile, the middle value of the data.
How do you calculate the interquartile range (IQR) using percentiles?
✗ Incorrect
IQR = Q3 (75th percentile) - Q1 (25th percentile), showing the middle 50% spread.
What parameter do you use in
np.percentile() to calculate percentiles along columns of a 2D array?✗ Incorrect
Use
axis=0 to calculate percentiles down columns (each column separately).If you want the 0th percentile of data, what value does
np.percentile() return?✗ Incorrect
The 0th percentile is the smallest value in the data.
Explain what a percentile is and how you can use
np.percentile() to find the median and quartiles in a dataset.Think about how percentiles split data into parts and how np.percentile helps find those split points.
You got /4 concepts.
Describe how to calculate the interquartile range (IQR) using
np.percentile() and why it is useful.IQR is the difference between two key percentiles that capture the middle half of data.
You got /4 concepts.