def quantiles(xs, qs=None, step=<NUM_LIT>, width=None, cellspacing=<NUM_LIT:3>):
if width is None:<EOL><INDENT>width = terminal.width()<EOL><DEDENT>qs_values = stats.quantiles(xs, qs=qs, step=step)<EOL>ncells = len(qs_values)<EOL>cellspacing_total = (ncells - <NUM_LIT:1>) * cellspacing<EOL>cell_width = int((width - cellspacing_total) / ncells)<EOL>cells = ['<STR_LIT>' % (q, format_float(value, cell_width - <NUM_LIT:6>)) for q, value in qs_values]<EOL>print ('<STR_LIT:U+0020>'*cellspacing).join(cells)<EOL>
Use stats.quantiles to get quantile-value pairs, and then print them to fit.
>>> import numpy as np
>>> quantiles(np.random.normal(size=10000), qs=[0, 5, 50, 95, 100])
 0% < -3.670    5% < -1.675   50% < -0.002   95% < 1.6500   100% < 3.4697
(Or something like that)