title: How to take column-slices of dataframe in pandas
body: <p>I load some machine learning data from a CSV file. The first 2 columns are observations and the remaining columns are features.</p>
  
  <p>Currently, I do the following:</p>
  
  <pre><code>data = pandas.read_csv('mydata.csv')
  </code></pre>
  
  <p>which gives something like:</p>
  
  <pre><code>data = pandas.DataFrame(np.random.rand(10,5), columns = list('abcde'))
  </code></pre>
  
  <p>I'd like to slice this dataframe in two dataframes: one containing the columns <code>a</code> and <code>b</code> and one containing the columns <code>c</code>, <code>d</code> and <code>e</code>.</p>
  
  <p>It is not possible to write something like </p>
  
  <pre><code>observations = data[:'c']
  features = data['c':]
  </code></pre>
  
  <p>I'm not sure what the best method is. Do I need a <code>pd.Panel</code>?</p>
  
  <p>By the way, I find dataframe indexing pretty inconsistent: <code>data['a']</code> is permitted, but <code>data[0]</code> is not. On the other side, <code>data['a':]</code> is not permitted but <code>data[0:]</code> is.
  Is there a practical reason for this? This is really confusing if columns are indexed by Int, given that <code>data[0] != data[0:1]</code></p>