title: python how to create an array based on condition
body: <p>I want to create an array with a format, and the values originate from another array. My input array consists out of three columns. I want to create an array with in the first row all values from the third column if the second column is equal. So in this example the first three values in the second column are equal, so in the new array i want the third value of each row in the new array. </p>
  
  <pre><code>a = 
  [[1,  1,  4],
  [2,  1,  6],
  [3,  1,  7],
  [4,  2,  0],
  [5,  2,  7],
  [6,  3,  1]]
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>b = 
  [[4, 6 , 7],
  [0, 7],
  [1]]
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>c = []    
  x = 1
  for row in a:
      if row[0] == x
          c.extend[row[2]]
      else:
          x = x + 1
          c.append(row[2])
  </code></pre>
  
  <p>But the result is a list of all 3rd values</p>