title: Spliting dataframe in 10 equal parts and merge 9 parts after picking one at a time in loop
body: <p>I need to split dataframe into 10 parts then use one part as  the testset and remaining 9 (merged to use as training set) , I have come up to the following code where I am able to split the dataset , and m trying to merge the remaining sets after picking one of those 10.
  The first iteration goes fine , but I get following error in second iteration.</p>
  
  <pre><code>df = pd.DataFrame(np.random.randn(10, 4), index=list(xrange(10)))
  
  for x in range(3):
      dfList = np.array_split(df, 3)
      testdf = dfList[x]
      dfList.remove(dfList[x])
      print testdf
      traindf = pd.concat(dfList)
      print traindf
      print "================================================"
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/BctWC.png" alt="enter image description here"></p>