After reading a csv using header/skiprows argument values become NaN
<p>I'm an trying to open a csv file with the header spanning multiple rows. To avoid dealing with MultiIndex I am using the header argument to skip some lines, but all values become NaNs.</p>

<p>An example which reproduces the error:</p>

<pre><code>,,
x,a,c
y,b,d
labels,l1,l2
2016-01-01,1,6
2016-01-02,2.0,7.0
2016-01-03,3.0,8
</code></pre>

<p>test.csv</p>

<pre><code>t = pandas.read_csv('test.csv',skiprows=3, header=[0], index_col=[0]
</code></pre>

<p>or</p>

<pre><code>t = pandas.read_csv('test.csv', header=[3], index_col=[0] )
</code></pre>

<p>produce the same output</p>

<pre><code>labels       l1   l2
2016-01-01  NaN  NaN
2016-01-02  NaN  NaN
2016-01-03  NaN  NaN

[3 rows x 2 columns]
</code></pre>

<p>When I'm using all 3 header rows</p>

<pre><code>t = pandas.read_csv('test.csv', header=[1,2,3], index_col=[0] )
</code></pre>

<p>it works and I can access the data.</p>

<p>Am I missing something or is this a bug?</p>

<p>ps: I'm now using the MultiIndex, I had a problem where I got a KeyError because i forgot one argument (the header has 8 rows ...)</p>

<p>try this:</p>

<pre><code>In [20]: pd.read_csv(filename, skiprows=3)
Out[20]:
       labels   l1   l2
0  2016-01-01  1.0  6.0
1  2016-01-02  2.0  7.0
2  2016-01-03  3.0  8.0
</code></pre>

python pandas