<h4 dir="auto">Code Sample</h4>
<p dir="auto">If test.csv file looks like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="a,b,c
0,1,2
1,2,3"><pre class="notranslate"><code class="notranslate">a,b,c
0,1,2
1,2,3
</code></pre></div>
<p dir="auto">Reading in the file with the header given in a list of length 0 results in no warnings or errors, but each line is interpreted as NaNs.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import pandas as pd
&gt;&gt;&gt; pd.read_csv(&quot;test.csv&quot;, header=[0])
      a     b     c
0   NaN   NaN   NaN
1   NaN   NaN   NaN"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">pd</span>.<span class="pl-en">read_csv</span>(<span class="pl-s">"test.csv"</span>, <span class="pl-s1">header</span><span class="pl-c1">=</span>[<span class="pl-c1">0</span>])
      <span class="pl-s1">a</span>     <span class="pl-s1">b</span>     <span class="pl-s1">c</span>
<span class="pl-c1">0</span>   <span class="pl-v">NaN</span>   <span class="pl-v">NaN</span>   <span class="pl-v">NaN</span>
<span class="pl-c1">1</span>   <span class="pl-v">NaN</span>   <span class="pl-v">NaN</span>   <span class="pl-v">NaN</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">Single-length lists are not a problem elsewhere in pandas or within read_csv. For example, passing <code class="notranslate">index_col=[0]</code> does not cause pandas to read a csv file incorrectly. Preferably pandas would read in the csv file correctly given a list of header rows with one element. Raising an error or warning would also be an improvement over the current functionality.</p>
<h4 dir="auto">Expected Output</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import pandas as pd
&gt;&gt;&gt; pd.read_csv(&quot;test.csv&quot;, header=[0])
    a   b   c
0   0   1   2
1   1   2   3"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">pd</span>.<span class="pl-en">read_csv</span>(<span class="pl-s">"test.csv"</span>, <span class="pl-s1">header</span><span class="pl-c1">=</span>[<span class="pl-c1">0</span>])
    <span class="pl-s1">a</span>   <span class="pl-s1">b</span>   <span class="pl-s1">c</span>
<span class="pl-c1">0</span>   <span class="pl-c1">0</span>   <span class="pl-c1">1</span>   <span class="pl-c1">2</span>
<span class="pl-c1">1</span>   <span class="pl-c1">1</span>   <span class="pl-c1">2</span>   <span class="pl-c1">3</span></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
OS: macOS Sierra
Python: 2.7.13
pandas: 0.20.2
pytest: None
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.25.2
numpy: 1.13.1
scipy: 0.19.1
xarray: None
IPython: 5.3.0
sphinx: None
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.0.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: None
</details>
<p dir="auto"><code class="notranslate">read_csv</code> with a single-row header either breaks any names that might be on the index, or reads all data as <code class="notranslate">NaN</code>.  This problem might exist because <code class="notranslate">pd.read_csv</code> hasn't caught up to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="36667985" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/7589" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/7589/hovercard" href="https://github.com/pandas-dev/pandas/issues/7589">#7589</a>.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
In [1]: import pandas as pd

In [2]: from StringIO import StringIO

In [3]: pd.read_csv(StringIO('''\
alpha,,A,B
foo,bar,,
this,x,1,2
this,y,5,6
that,x,3,4
that,y,7,8'''), header=0, index_col=[0,1])
Out[3]: 
                   A   B
alpha Unnamed: 1        
foo   bar        NaN NaN
this  x            1   2
      y            5   6
that  x            3   4
      y            7   8

In [4]: pd.read_csv(StringIO('''\
alpha,,A,B
foo,bar,,
this,x,1,2
this,y,5,6
that,x,3,4
that,y,7,8'''), header=[0], index_col=[0,1])
Out[4]: 
alpha       A    B
foo  bar          
this x    NaN  NaN
     y    NaN  NaN
that x    NaN  NaN
     y    NaN  NaN

In [5]: pd.read_csv(StringIO('''\
alpha,,A,B
beta,,Y,Z
foo,bar,,
this,x,1,2
this,y,5,6
that,x,3,4                                  
that,y,7,8'''), header=[0,1], index_col=[0,1])
Out[5]: 
alpha     A  B
beta      Y  Z
foo  bar      
this x    1  2
     y    5  6
that x    3  4
     y    7  8
"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">1</span>]: <span class="pl-s1">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>

<span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">from</span> <span class="pl-v">StringIO</span> <span class="pl-k">import</span> <span class="pl-v">StringIO</span>

<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">pd</span>.<span class="pl-en">read_csv</span>(<span class="pl-v">StringIO</span>(<span class="pl-s">'''<span class="pl-cce">\</span></span>
<span class="pl-s"><span class="pl-cce"></span>alpha,,A,B</span>
<span class="pl-s">foo,bar,,</span>
<span class="pl-s">this,x,1,2</span>
<span class="pl-s">this,y,5,6</span>
<span class="pl-s">that,x,3,4</span>
<span class="pl-s">that,y,7,8'''</span>), <span class="pl-s1">header</span><span class="pl-c1">=</span><span class="pl-c1">0</span>, <span class="pl-s1">index_col</span><span class="pl-c1">=</span>[<span class="pl-c1">0</span>,<span class="pl-c1">1</span>])
<span class="pl-v">Out</span>[<span class="pl-c1">3</span>]: 
                   <span class="pl-v">A</span>   <span class="pl-v">B</span>
<span class="pl-s1">alpha</span> <span class="pl-v">Unnamed</span>: <span class="pl-c1">1</span>        
<span class="pl-s1">foo</span>   <span class="pl-s1">bar</span>        <span class="pl-v">NaN</span> <span class="pl-v">NaN</span>
<span class="pl-s1">this</span>  <span class="pl-s1">x</span>            <span class="pl-c1">1</span>   <span class="pl-c1">2</span>
      <span class="pl-s1">y</span>            <span class="pl-c1">5</span>   <span class="pl-c1">6</span>
<span class="pl-s1">that</span>  <span class="pl-s1">x</span>            <span class="pl-c1">3</span>   <span class="pl-c1">4</span>
      <span class="pl-s1">y</span>            <span class="pl-c1">7</span>   <span class="pl-c1">8</span>

<span class="pl-v">In</span> [<span class="pl-c1">4</span>]: <span class="pl-s1">pd</span>.<span class="pl-en">read_csv</span>(<span class="pl-v">StringIO</span>(<span class="pl-s">'''<span class="pl-cce">\</span></span>
<span class="pl-s"><span class="pl-cce"></span>alpha,,A,B</span>
<span class="pl-s">foo,bar,,</span>
<span class="pl-s">this,x,1,2</span>
<span class="pl-s">this,y,5,6</span>
<span class="pl-s">that,x,3,4</span>
<span class="pl-s">that,y,7,8'''</span>), <span class="pl-s1">header</span><span class="pl-c1">=</span>[<span class="pl-c1">0</span>], <span class="pl-s1">index_col</span><span class="pl-c1">=</span>[<span class="pl-c1">0</span>,<span class="pl-c1">1</span>])
<span class="pl-v">Out</span>[<span class="pl-c1">4</span>]: 
<span class="pl-s1">alpha</span>       <span class="pl-v">A</span>    <span class="pl-v">B</span>
<span class="pl-s1">foo</span>  <span class="pl-s1">bar</span>          
<span class="pl-s1">this</span> <span class="pl-s1">x</span>    <span class="pl-v">NaN</span>  <span class="pl-v">NaN</span>
     <span class="pl-s1">y</span>    <span class="pl-v">NaN</span>  <span class="pl-v">NaN</span>
<span class="pl-s1">that</span> <span class="pl-s1">x</span>    <span class="pl-v">NaN</span>  <span class="pl-v">NaN</span>
     <span class="pl-s1">y</span>    <span class="pl-v">NaN</span>  <span class="pl-v">NaN</span>

<span class="pl-v">In</span> [<span class="pl-c1">5</span>]: <span class="pl-s1">pd</span>.<span class="pl-en">read_csv</span>(<span class="pl-v">StringIO</span>(<span class="pl-s">'''<span class="pl-cce">\</span></span>
<span class="pl-s"><span class="pl-cce"></span>alpha,,A,B</span>
<span class="pl-s">beta,,Y,Z</span>
<span class="pl-s">foo,bar,,</span>
<span class="pl-s">this,x,1,2</span>
<span class="pl-s">this,y,5,6</span>
<span class="pl-s">that,x,3,4                                  </span>
<span class="pl-s">that,y,7,8'''</span>), <span class="pl-s1">header</span><span class="pl-c1">=</span>[<span class="pl-c1">0</span>,<span class="pl-c1">1</span>], <span class="pl-s1">index_col</span><span class="pl-c1">=</span>[<span class="pl-c1">0</span>,<span class="pl-c1">1</span>])
<span class="pl-v">Out</span>[<span class="pl-c1">5</span>]: 
<span class="pl-s1">alpha</span>     <span class="pl-v">A</span>  <span class="pl-v">B</span>
<span class="pl-s1">beta</span>      <span class="pl-v">Y</span>  <span class="pl-v">Z</span>
<span class="pl-s1">foo</span>  <span class="pl-s1">bar</span>      
<span class="pl-s1">this</span> <span class="pl-s1">x</span>    <span class="pl-c1">1</span>  <span class="pl-c1">2</span>
     <span class="pl-s1">y</span>    <span class="pl-c1">5</span>  <span class="pl-c1">6</span>
<span class="pl-s1">that</span> <span class="pl-s1">x</span>    <span class="pl-c1">3</span>  <span class="pl-c1">4</span>
     <span class="pl-s1">y</span>    <span class="pl-c1">7</span>  <span class="pl-c1">8</span></pre></div>