What are quartiles?
Let’s say we have a dataset. If we sort the dataset in ascending order, then quartiles divide the dataset into four equal parts.
Q0 is the smallest number in the dataset and is called quartile 0. Q2 is the median of the dataset and is called quartile 2. Q1 is the middle number between the smallest number of the dataset, or Q0, and the median of the dataset, or Q2. This Q1 is called quartile 1. Q4 is the largest number of the dataset and is called quartile 4. And Q3 is the middle number between the median of the dataset or Q2 and the largest number of the dataset, or Q4, and Q3 is called quartile 3.
How to calculate quartiles in Python?
In Python, we can use the quantile() function from the numpy module to calculate the quartiles of a dataset. …






0 Comments