title: Splitting a large Pandas Dataframe with minimal memory footprint
body: <p>I have a large DataFrame, which I would like to split into a test set and a train set for model building. However, I do not want to duplicate the DataFrame because I am reaching a memory limit.</p>
  
  <p>Is there an operation, similar to pop but for a large segment, that will simultaneously remove a portion of the DataFrame and allow me to assign it to a new DataFrame? Something like this:</p>
  
  <pre><code># Assume I have initialized a DataFrame (called "all") which contains my large dataset, 
  # with a boolean column called "test" which indicates whether a record should be used for
  # testing.
  print len(all)
  # 10000000 
  test = all.pop_large_segment(all[test]) # not a real command, just a place holder
  print len(all)
  # 8000000
  print len(test)     
  # 2000000
  </code></pre>