title: Split an array dependent on the array values in Python
body: <p>I have an array of coordinates like this:</p>
  
  <pre><code>array = [[1,6],[2,6],[3,8],[4,10],[5,6],[5,7],[18,6],[19,5],[17,9],[10,5]]
  </code></pre>
  
  <p>I want to split the array between <code>6</code>. and <code>7</code>. coordinate <code>([5,7],[18,6])</code> because there is a gap in the <code>X</code> value there. I want to get two separate arrays, <code>arr1</code> and <code>arr2</code>, where <code>arr1</code> is the values before the split and <code>arr2</code> is the values after. </p>
  
  <p>I want to say that if the next <code>X</code> value is larger than a difference of <code>10</code>, it will append to <code>arr2</code>, else <code>arr1</code>, something like this:  </p>
  
  <pre><code>arr1 = []
  arr2 = []
  for [x,y] in array: 
      if next(x) &gt; 10:
          arr2.append(x,y)
      else:
          arr1.append(x,y)
  </code></pre>
  
  <p>Can someone please help me with this problem?</p>