DEV Community

Cover image for Find the Mode of Intervals
Jackson Reeves
Jackson Reeves

Posted on • Edited on

Find the Mode of Intervals

A simple Python function for calculating the MQR, a nifty statistical measure of spread that I came up with one night.

I was annoyed that every measure of central tendency had a corresponding measure of spread—except mode. Mean has standard deviation; median has interquartile range. But what about mode? So for the sake of parity, I made one up.

I call it the Minimal Quintile Range (or MQR), which provides the length of the smallest interval that contains at least a fifth of the data in a set. In other words, the mode of intervals.

Top comments (0)