title: Splitting Pandas dataframe on string properties index
body: <p>I'm trying to split a dataset into 2 types of datapoints. Currently I have a pandas dataframe with this format.</p>
  
  <pre><code>CS1001    True    value1
  CM1001    False   value2
  CS1002    True    value3
  </code></pre>
  
  <p>Now i would like to split this into a S and a M dataframe like this:</p>
  
  <p>S frame:</p>
  
  <pre><code>C1001    True    value1
  C1002    True    value3
  </code></pre>
  
  <p>M frame:</p>
  
  <pre><code>C1001    False   value2
  </code></pre>
  
  <p>Now i run into two problems fistly I can't seem to group on the first 4 characters with this.</p>
  
  <pre><code>data.groupby(data.index[:4])
  </code></pre>
  
  <p>And then I can't edit the index value to remove the S/M. I have not used pandas before so I feel like I'm overseeing an obvious solution but I can't figure it out.</p>