title: How can I split dataset into several dataframe in python?
body: <p>I have a dataset which has thousand of rows with a column 'state' and some other columns.</p>
  <p>A sample dataset</p>
  <p><a href="https://i.stack.imgur.com/rzEbJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rzEbJ.png" alt="sample dataset" /></a></p>
  <pre><code>import pandas as pd
  data = {'State':['C','C','C','R','R','D','D','R','C','C','R','D','R','C','R','D','R'],
          'Qd': [3, 2, 1, 0,2,2,5,7,9,7,14,34,12,10,11,14,15], 
          
  df = pd.DataFrame.from_dict(data)
  </code></pre>
  <p>The 'State' column has a loop type input value like 'C,R,D,R' and then again 'C,R,D,R'. I want to split the dataset into several dataframe like</p>
  <p>df1</p>
  <p><a href="https://i.stack.imgur.com/d9cn0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d9cn0.png" alt="" /></a></p>
  <p>df2</p>
  <p><a href="https://i.stack.imgur.com/ZaTDE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZaTDE.png" alt="" /></a></p>
  <p>df3</p>
  <p><a href="https://i.stack.imgur.com/rQXWS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rQXWS.png" alt="" /></a></p>
  <p>Each dataframe will contain one complete loop from the State Column. How to do this?</p>
  <p>I am thinking to create a list of dataframe and use a for loop to store each loop value in each dataframe.</p>