|
Quartiles (Python) +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (https://www.hpmuseum.org/forum/forum-10.html) +--- Forum: HP Prime Software Library (https://www.hpmuseum.org/forum/forum-15.html) +--- Thread: Quartiles (Python) (/thread-23551.html) |
Quartiles (Python) - Eddie W. Shore - 2025-05-14 25th, 50th, and 75th Percentiles The following code finds five points of a list of data points: Minimum: the data point of least value Q1: the first quartile, known as the 25th percentile. The first quartile is median of the lower half of the data. Median: also known as the 50th percentile, this is the median, or middle point of the data. Q3: the third quartile, known as the 75th percentile. The third quartile is the median of the upper half of the data. Maximum: the data point of the most value The list of data is first sorted in ascending order. The median is determined as follows: If the number of data points is odd: Take the number that lies in the middle. If the number of data points is even: Take the average of the middle two numbers. The way quartile values are determine vary depending by country and jurisdiction. The program presented uses Method 1, which is used in the United States. If the number of data points is odd: The data is split in half, do not include the median. If the number of data points is even: The data is split in half. Wikipedia. “Quartile” Last edited on February 21, 2025. https://en.wikipedia.org/wiki/Quartile Accessed May 12, 2025. Code: # quartiles program |