title: Splitting pandas data frame based on column name
body: <p>Is there a way to split a pandas data frame based on the column name? As an example consider the data frame has the following columns <code>df = ['A_x', 'B_x', 'C_x', 'A_y', 'B_y', 'C_y']</code> and I want to create two data frames <code>X = ['A_x', 'B_x', 'C_x']</code>and <code>Y = ['A_y', 'B_y', 'C_y']</code>.</p>
  
  <p>I know there is a possibility to do this:</p>
  
  <pre><code>d = {'A': df.A_x, 'B': df.B_x, 'C': df.B_x}
  X = pd.DataFrame (data=d)
  </code></pre>
  
  <p>but this would not be ideal as in my case I have 2200 columns in <code>df</code>. Is there a more elegant solution?</p>