def cdf_distribution(a_cdf, a_partitions):
f_range = a_cdf[-<NUM_LIT:1>] - a_cdf[<NUM_LIT:0>]<EOL>f_rangePart = f_range / a_partitions<EOL>lowerBound = a_cdf[<NUM_LIT:0>]<EOL>vl = []<EOL>for part in arange(<NUM_LIT:0>, a_partitions):<EOL><INDENT>if part == a_partitions - <NUM_LIT:1>:<EOL><INDENT>subset = (a_cdf > lowerBound)<EOL><DEDENT>else:<EOL><INDENT>subset = (a_cdf > lowerBound) & (a_cdf <= lowerBound + f_rangePart)<EOL><DEDENT>indices = where(subset, <NUM_LIT:1>, <NUM_LIT:0>)<EOL>v = where(indices == <NUM_LIT:1>)<EOL>vl.append(v)<EOL>lowerBound += f_rangePart<EOL><DEDENT>return vl<EOL>
ARGS
   a_cdf               vector         a vectors of values/observations
   a_partitions        int            the number of partitions

DESC
    This function returns the indices of a passed cdf such that the
    the range of values across the indices is uniform across the
    number of partitions.

    Imagine you have a range of observations/values, and you'd
    like to partition the observations over 3 ranges. If you simply
    partition the range of values into three evenly spaced groups
    across the domain, you will most likely find all the dynamic range
    of values in each partition is non-uniform.

    By partitioning the cdf, however, the range of values in each
    partition is uniform. The "size" of each partition, however,
    is not.