title: Index out of bound while reading a dataframe
body: <p>I have a tab separated file that I am trying to parse and for that I am doing this :</p>
  
  <p>header of my file :</p>
  
  <pre><code>chrom   coord   ref_base    var_base    A   C   G   T
  17  26695663    G   A   1   0   1934    0
  17  26695664    T   A   1   0   1   1935 
  </code></pre>
  
  <p>my code is :</p>
  
  <pre><code>counts = pd.read_csv(args.counts_file, sep='\t')
  toto = counts[(counts['chrom'].astype(str) == "17") &amp; (counts['coord'].astype(str) == "26695663")]
  print toto["G"].values[0]
  </code></pre>
  
  <p>this function returns the number wanted which is 1934</p>
  
  <p>Now when I try to create a function that takes arguments the dataframe read from the file, I wrote this function</p>
  
  <pre><code>def get_foreground_counts(chrom, coord, counts, ref_base, var_base):
  
       foreground_counts = counts[(counts['chrom'] == chrom) &amp; (counts['coord'] == coord)]
  
       foreground_ref_counts = foreground_counts[ref_base].values[0]
  
       foreground_var_counts = foreground_counts[var_base].values[0]
  
       return foreground_ref_counts, foreground_var_counts
  </code></pre>
  
  <p>I got this error that I am trying to figure out but still cant see why </p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 203, in &lt;module&gt;
      main(args)
    File "test.py", line 71, in main
      foreground_ref_counts, foreground_var_counts = get_foreground_counts(chrom, coord, counts, ref_base, var_base)
    File "test.py", line 137, in get_foreground_counts
      foreground_ref_counts = foreground_counts[ref_base].values[0]
  IndexError: index out of bounds
  </code></pre>
  
  <p>Any idea why ?</p>
  
  <p>Thanks</p>
  
  <p><em>UPDATE</em></p>
  
  <ul>
  <li>When I try to print foreground_counts[ref_base].values I get this <code>[]</code> </li>
  <li>What I am passing to the function is chrom (string), coord(string), counts(panda dataframe), ref_base (string), var_base(string) )</li>
  </ul>