Skip to content

Instantly share code, notes, and snippets.

View jvollme's full-sized avatar

JohnVollmers jvollme

View GitHub Profile
@tinybike
tinybike / weighted_median.py
Last active July 4, 2023 15:03
calculate a weighted median
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
calculate a weighted median
@author Jack Peterson (jack@tinybike.net)
"""
from __future__ import division
import numpy as np
def weighted_median(data, weights):