title: Split by columns of 2d list into new list
body: <p>I have <a href="http://archive.ics.uci.edu/ml/datasets/Thoracic+Surgery+Data" rel="nofollow">the Thoracic Surgery dataset</a> from <a href="http://archive.ics.uci.edu/ml/index.html" rel="nofollow">the UCI dataset repository</a>.<br>
  A single line from this dataset looks like this:</p>
  
  <pre><code>DGN3,4.36,3.28,PRZ1,F,F,F,T,F,OC12,T,F,F,T,F,59,T
  </code></pre>
  
  <p>I have a script that reads these lines into a list of sublists:<br>
  Each sublist is a line in the file, containing some transformation of the data (mostly, just turning each element in the line into some numerical value; this part is not relevant to the problem)</p>
  
  <p>Thus, each sublist looks like this:</p>
  
  <pre><code>[3.0, 4.36, 3.28, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 12.0, 1.0, 0.0, 0.0, 1.0, 0.0,59.0, 1.0]
  </code></pre>
  
  <p>Now, what I would like to do is turn this list of sublists into two lists of sublists, where:</p>
  
  <ul>
  <li>the <code>i</code>th sublist of the first list contains everything but the last element of the <code>i</code>th sublist of the original list</li>
  <li>the <code>i</code>th sublist of the second list contains only the last element of the <code>i</code>th sublist of the original list.</li>
  </ul>
  
  <p>For example, the row (sublist) shown above would be split into two sublists as follows:</p>
  
  <pre><code>[3.0, 4.36, 3.28, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 12.0, 1.0, 0.0, 0.0, 1.0, 0.0,59.0]
  [1.0]
  </code></pre>
  
  <p>Now, I know that I can do this very easily as follows:</p>
  
  <pre><code>features, classes = [], []
  for subl in L:
      features.append(subl[:-1])
      classes.append([subl[-1]])
  </code></pre>
  
  <p>I was wondering if there's a better way to do this. Is there perhaps an itertools recipe or somthing out of numpy that would be better suited for this?</p>