0
0
NumPydata~5 mins

Percentiles with np.percentile() in NumPy - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AThe average of the data in <code>arr</code>
BThe value below which 90% of the data in <code>arr</code> falls
CThe maximum value in <code>arr</code>
DThe value above which 90% of the data falls
Which percentile corresponds to the median?
A50th percentile
B25th percentile
C75th percentile
D100th percentile
How do you calculate the interquartile range (IQR) using percentiles?
A50th percentile minus 25th percentile
BMaximum minus minimum
C75th percentile minus 25th percentile
D25th percentile plus 75th percentile
What parameter do you use in np.percentile() to calculate percentiles along columns of a 2D array?
Aaxis=2
Baxis=1
Caxis=None
Daxis=0
If you want the 0th percentile of data, what value does np.percentile() return?
AMinimum value
BMaximum value
CMean value
DMedian value
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.