title: pandas: split index string and sum up rows of equal slices
body: <p>I want to split the row index strings of a DataFrame and sum rows of equals slices. Something like:</p>
  
  <pre><code>idx       val1 val2 val3
  con-991-1 1    1    1
  con-991-2 1    0    1
  con-732   0    0    0
  con-55-1  1    0    1
  con-55-2  0    1    1 
  </code></pre>
  
  <p>turn to:</p>
  
  <pre><code>con-991   2    1    2
  con-732   0    0    0
  con-55    1    1    2
  </code></pre>
  
  <p>Here goes what I have so far:</p>
  
  <pre><code>df = DataFrame()
  df['new'] = df1.index
  df = DataFrame(df.new.str.split('-').tolist(), index=df1.index, columns=['pre', 'med', 'sux'])
  dfnew = concat([df1, df], axis=1, ignore_index=False)
  dfnew['index'] = dfnew.index
  dfnew.reset_index(level=0, inplace=True)
  #dfnew.index = MultiIndex.from_tuples(list(zip(dfnew['index'], dfnew[1])), names=['base1', 'base2'])           
  print(dfnew.groupby(['index', 'med']).sum())
  </code></pre>
  
  <p>My code is not working and also is definitely not pythonic.
  Is there a better way to do that?
  Best.     </p>