[SciPy-Dev] splitting an ordered list as evenly as possilbe

Keith Goodman kwgoodman@gmail....
Wed Aug 25 09:10:56 CDT 2010

On Wed, Aug 25, 2010 at 7:00 AM, John Hunter <jdh2358@gmail.com> wrote:
> Suppose I have an ordered list/array of numbers, and I want to split
> them into N chunks, such that the intersection of any chunk with each
> other is empty and the data is split as evenly as possible (eg the std
> dev of the lengths of the chunks is minimized or some other such
> criterion).

How about using the percentiles of np.unique(x)? That takes care of
the first constraint (no overlap) but ignores the second constraint
(min std of cluster size).

More information about the SciPy-Dev mailing list