# Online Median Calculation

**URL:** <https://discuss.hail.is/t/online-median-calculation/275>\
**Category:** Development\
**Created:** [September 7, 2017, 7:26pm UTC](https://discuss.hail.is/t/online-median-calculation/275 "2017-09-07T19:26:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [September 7, 2017, 7:26pm UTC](https://discuss.hail.is/t/online-median-calculation/275/1 "2017-09-07T19:26:27Z")

</div>

cc @tpoterba

We need online median calculation in Hail. Currently, the closest thing you can get to a median is to calculate a histogram of your data using `hist` and then determine the bin in which the median resides (by finding the weighted median of the bins).

It would be nice if there was an `Aggregable[Numeric].median()` aggregator. What are some strategies for doing this with RDDs?
