title: thinning out data in pandas/python to get best possible "even" distribution
body: <p><strong>Task definition</strong></p>
  <ul>
  <li>Given: set of unique float values (size=<code>N</code>)</li>
  <li>Find: sub-set of fixed size <code>K</code>, where min/max values of original set are included, but other <code>K-2</code> values are <em><strong>distributed as evenly as possible</strong></em></li>
  <li>Example: when <code>N=51</code>, and the set consists of unique integer values between 0 and 50, and <code>K=6</code>, then the desired sub-set would be <code>{0, 10, 20, 30, 40, 50}</code></li>
  </ul>
  <p><strong>Challenges</strong></p>
  <p>In fact, the original set often represents uneven distribution. It can be something like <code>{1, 2, 3, 4, 5, 7, 9, 11, 19, 37, 50}</code>. Because of it:</p>
  <ol>
  <li>approach with taking each i-th value will not work (where
  <code>i=(N-1)/(K-1)</code>) - I need to take both 19 and 37 in my example</li>
  <li>approach with finding &quot;ideal&quot; values <code>{0, 10, 20, 30, 40, 50}</code> first and then closest to them will not allow simple implementation (37 is closest to both 30 and 40 in my example)</li>
  </ol>
  <p>I think I understand how I can extend the second solution to implement it.
  But I wonder if my task can be reduced to some standard task, so that I can use existing functionality of python or pandas. I would appreciate any advise on it.</p>
  <p>It can be formulated in generic way that I am trying <em><strong>to minimize the deviation of difference between two adjacent values of ordered K-subset: K(i) - K(i-1)</strong></em></p>