title: pandas how to find continuous values in a series whose differences are within a certain distance
body: <p>I have a <code>pandas</code> <code>Series</code> that is composed of <code>int</code>s</p>
  
  <pre><code>a = np.array([1,2,3,5,7,10,13,16,20])
  pd.Series(a)
  
  0  1
  1  2
  2  3
  3  5
  4  7
  5  10
  6  13
  7  16
  8  20
  </code></pre>
  
  <p>now I want to cluster the series into groups that in each group, the differences between two neighbour values are <code>&lt;=</code> distance. For example, if the distance is defined as <code>1</code>, we have</p>
  
  <pre><code>[1,2,3], [5], [7], [10], [13], [16], [20]
  </code></pre>
  
  <p>if the distance is <code>2</code>, we have</p>
  
  <pre><code>[1,2,3,5,7], [10], [13], [16], [20]
  </code></pre>
  
  <p>if the distance is <code>3</code>, we have</p>
  
  <pre><code>[1,2,3,5,7,10,13,16], [20]
  </code></pre>
  
  <p>how to do this using <code>pandas</code>/<code>numpy</code>? </p>