title: How to find the groups of consecutive elements in a NumPy array
body: <p>I have to cluster the consecutive elements from a NumPy array. Considering the following example</p>
  
  <pre><code>a = [ 0, 47, 48, 49, 50, 97, 98, 99]
  </code></pre>
  
  <p>The output should be a list of tuples as follows</p>
  
  <pre><code>[(0), (47, 48, 49, 50), (97, 98, 99)]
  </code></pre>
  
  <p>Here the difference is just one between the elements. It will be great if the difference can also be specified as a limit or a hardcoded number.</p>