def quantile(data, num_breaks):
def scipy_mquantiles(a, prob=list([<NUM_LIT>,<NUM_LIT>,<NUM_LIT>]), alphap=<NUM_LIT>, betap=<NUM_LIT>, axis=None, limit=()):<EOL><INDENT>"""<STR_LIT>"""<EOL>def _quantiles1D(data,m,p):<EOL><INDENT>x = numpy.sort(data.compressed())<EOL>n = len(x)<EOL>if n == <NUM_LIT:0>:<EOL><INDENT>return numpy.ma.array(numpy.empty(len(p), dtype=float), mask=True)<EOL><DEDENT>elif n == <NUM_LIT:1>:<EOL><INDENT>return numpy.ma.array(numpy.resize(x, p.shape), mask=numpy.ma.nomask)<EOL><DEDENT>aleph = (n*p + m)<EOL>k = numpy.floor(aleph.clip(<NUM_LIT:1>, n-<NUM_LIT:1>)).astype(int)<EOL>gamma = (aleph-k).clip(<NUM_LIT:0>,<NUM_LIT:1>)<EOL>return (<NUM_LIT:1.>-gamma)*x[(k-<NUM_LIT:1>).tolist()] + gamma*x[k.tolist()]<EOL><DEDENT>data = numpy.ma.array(a, copy=False)<EOL>if data.ndim > <NUM_LIT:2>:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if limit:<EOL><INDENT>condition = (limit[<NUM_LIT:0>] < data) & (data < limit[<NUM_LIT:1>])<EOL>data[~condition.filled(True)] = numpy.ma.masked<EOL><DEDENT>p =  numpy.array(prob, copy=False, ndmin=<NUM_LIT:1>)<EOL>m = alphap + p*(<NUM_LIT:1.>-alphap-betap)<EOL>if (axis is None):<EOL><INDENT>return _quantiles1D(data, m, p)<EOL><DEDENT>return numpy.ma.apply_along_axis(_quantiles1D, axis, data, m, p)<EOL><DEDENT>return scipy_mquantiles(data, numpy.linspace(<NUM_LIT:1.0> / num_breaks, <NUM_LIT:1>, num_breaks))<EOL>
Calculate quantile breaks.

Arguments:
data -- Array of values to classify.
num_breaks -- Number of breaks to perform.