title: filter list of tuples by certain axis
body: <p>I have a csv file with 3 columns of x,y,z coordinates, i.e. this format:</p>
  
  <p><a href="https://i.stack.imgur.com/qK4jP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qK4jP.png" alt="enter image description here"></a></p>
  
  <p>I used the code below, to import it and process its data:</p>
  
  <pre class="lang-py prettyprint-override"><code>import csv
  from operator import itemgetter
  
  csvfile = open(r'C:\Users\%username%\Desktop\Deep-lizard\x_y_z coor.csv')
  
  inFile = csv.reader(csvfile)
  # skip header
  inFile.__next__()
  
  #Read and sort the vertices coordinates (sort by x and y)
  vertices = sorted( [(float(r[0]), float(r[1]), float(r[2])) for r in inFile], key = itemgetter(0,1) )
  </code></pre>
  
  <p>This turns <code>vertices</code> into a list of tuples:
  <a href="https://i.stack.imgur.com/wUCMS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wUCMS.png" alt="enter image description here"></a> </p>
  
  <p>What I want to achieve is filter the list so that, if the third element in the tuple (i.e. the z coordinate) is bigger than 0, then include that entry (the tuple of 3 elements) in the list otherwise if it's 0 then don't include it. What's the best way of doing this?</p>