def _get_median_value(cls, values):
     if isinstance(values, dict):
         values = [v for v in values.values() if v]
     if values:
         return percentile(values, 50)
     return None
Exemple #2
0
def test_percentile(q, array, result):
    assert stats.percentile(array, q) == result
Exemple #3
0
def time_series_operator_perc(tsp, percentile):
    points = len(tsp)
    tsp = clean_time_series_point(tsp)
    perc = stats.percentile(tsp, percentile) if tsp else None
    return [perc] * points