title: read csv files pandas slice arrays
body: <p>I'm a python newbie and am having trouble reading a csv to pandas and working with it. Here is a bit of my csv file: </p>
  
  <pre><code>A   B
  1   56
  2   76
  3   23
  4   45
  5   54
  6   65
  7   22
  </code></pre>
  
  <p>And my python code:</p>
  
  <pre><code>import numpy as np
  import pandas as pd 
  from math import exp
  from math import sqrt
  
  g = pd.DataFrame.from_csv('test.csv')
  
  a = g.iloc[2:4,1]
  print(a)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>IndexError: index 1 is out of bounds for axis 0 with size 1
  </code></pre>
  
  <p>I've also tried: </p>
  
  <pre><code>a = g.iloc[2:4,'B']
  </code></pre>
  
  <p>and many other permutations for defining columns and rows.</p>
  
  <p>Also when I print g, I get the following:</p>
  
  <pre><code>             B
  A             
  2015-05-01  56
  2015-05-02  76
  2015-05-03  23
  2015-05-04  45
  2015-05-05  54
  2015-05-06  65
  2015-05-07  22
  </code></pre>
  
  <p>I can't understand why A and B are not aligned. </p>
  
  <p>I'm just using this an example, but in general I'd like to read in large csv files and then perform operations on certain aspects of the matrix. </p>
  
  <p>Any help would be appreciated. </p>