MCPcopy Index your code
hub / github.com/clips/pattern / boxplot

Function boxplot

pattern/metrics.py:657–668  ·  view source on GitHub ↗

Returns a tuple (min(list), Q1, Q2, Q3, max(list)) for the given list of values. Q1, Q2, Q3 are the quantiles at 0.25, 0.5, 0.75 respectively.

(list, **kwargs)

Source from the content-addressed store, hash-verified

655#print quantile(range(10), p=0.5) == median(range(10))
656
657def boxplot(list, **kwargs):
658 """ Returns a tuple (min(list), Q1, Q2, Q3, max(list)) for the given list of values.
659 Q1, Q2, Q3 are the quantiles at 0.25, 0.5, 0.75 respectively.
660 """
661 # http://en.wikipedia.org/wiki/Box_plot
662 kwargs.pop("p", None)
663 kwargs.pop("sort", None)
664 s = sorted(list)
665 Q1 = quantile(s, p=0.25, sort=False, **kwargs)
666 Q2 = quantile(s, p=0.50, sort=False, **kwargs)
667 Q3 = quantile(s, p=0.75, sort=False, **kwargs)
668 return float(min(s)), Q1, Q2, Q3, float(max(s))
669
670#--- FISHER'S EXACT TEST ---------------------------------------------------------------------------
671

Callers

nothing calls this directly

Calls 2

quantileFunction · 0.85
popMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…