<h4 dir="auto">Problem description</h4>
<p dir="auto">When using Pandas read_excel function with an Excel file that has a column heading that is blank, Pandas will regard the column with the blank heading as the index.</p>
<p dir="auto">Consider this example file:  <a href="test_file.xlsx">https://tinyurl.com/y8br2js4</a><br>
Within this file, column B does not have a column heading, it is just a blank cell.  The rest of the columns have names.</p>
<p dir="auto">When running this code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd

xlsx_file = './Input/Test_File.xlsx'

test_df = pd.read_excel(xlsx_file,
                        index_col=None,
                        usecols='B, C, E, F')"><pre class="notranslate"><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-s1">xlsx_file</span> <span class="pl-c1">=</span> <span class="pl-s">'./Input/Test_File.xlsx'</span>

<span class="pl-s1">test_df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">read_excel</span>(<span class="pl-s1">xlsx_file</span>,
                        <span class="pl-s1">index_col</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
                        <span class="pl-s1">usecols</span><span class="pl-c1">=</span><span class="pl-s">'B, C, E, F'</span>)</pre></div>
<p dir="auto">The resulting dataframe will use column B as the index, even though index_col=None is specified.  If I add column A to usecols, the dataframe processes the file as expected.</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.6.5.final.0<br>
python-bits: 64<br>
OS: Windows<br>
OS-release: 10<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.22.0<br>
pytest: 3.5.1<br>
pip: 10.0.1<br>
setuptools: 39.1.0<br>
Cython: 0.28.2<br>
numpy: 1.14.3<br>
scipy: 1.1.0<br>
pyarrow: 0.8.0<br>
xarray: None<br>
IPython: 6.4.0<br>
sphinx: 1.7.4<br>
patsy: 0.5.0<br>
dateutil: 2.7.2<br>
pytz: 2018.4<br>
blosc: None<br>
bottleneck: 1.2.1<br>
tables: 3.4.3<br>
numexpr: 2.6.5<br>
feather: 0.4.0<br>
matplotlib: 2.2.2<br>
openpyxl: 2.5.3<br>
xlrd: 1.1.0<br>
xlwt: 1.3.0<br>
xlsxwriter: 1.0.4<br>
lxml: 4.2.1<br>
bs4: 4.6.0<br>
html5lib: 1.0.1<br>
sqlalchemy: 1.2.7<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.10<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details>
<h3 dir="auto">Code Sample, a copy-pastable example if possible</h3>
<p dir="auto"><strong>Example 1 (weird column/value assignment)</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import pandas as pd

# Writing excel file with no column name in first column
tab = pd.DataFrame([['a', 'x'], ['b', 'y']], columns=['col1', 'col2'])
print('Original:\n', tab)
tab.to_excel('tmp_can_del.xlsx')

# The table read using read_excel assigns values of col1 to col2
new_tab = pd.read_excel('tmp_can_del.xlsx', index_col=2)
print('Read:\n', new_tab)"><pre class="notranslate"><code class="notranslate">import pandas as pd

# Writing excel file with no column name in first column
tab = pd.DataFrame([['a', 'x'], ['b', 'y']], columns=['col1', 'col2'])
print('Original:\n', tab)
tab.to_excel('tmp_can_del.xlsx')

# The table read using read_excel assigns values of col1 to col2
new_tab = pd.read_excel('tmp_can_del.xlsx', index_col=2)
print('Read:\n', new_tab)
</code></pre></div>
<p dir="auto"><strong>Example 2 (index_col=None seems not to work)</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import pandas as pd

# Writing excel file with no column name in first column
tab = pd.DataFrame([['a', 'x'], ['b', 'y']], columns=['col1', 'col2'], index=['i1', 'i2'])
print('Original:\n', tab)
tab.to_excel('tmp_can_del.xlsx')

# The table read using read_excel should have three columns (`Unnamed: 0`, `col1`, `col2`) but just has two
new_tab = pd.read_excel('tmp_can_del.xlsx', index_col=None)
print('Read:\n', new_tab)
print(new_tab.columns)"><pre class="notranslate"><code class="notranslate">import pandas as pd

# Writing excel file with no column name in first column
tab = pd.DataFrame([['a', 'x'], ['b', 'y']], columns=['col1', 'col2'], index=['i1', 'i2'])
print('Original:\n', tab)
tab.to_excel('tmp_can_del.xlsx')

# The table read using read_excel should have three columns (`Unnamed: 0`, `col1`, `col2`) but just has two
new_tab = pd.read_excel('tmp_can_del.xlsx', index_col=None)
print('Read:\n', new_tab)
print(new_tab.columns)
</code></pre></div>
<h3 dir="auto">Problem description</h3>
<p dir="auto">The <code class="notranslate">index_col</code> option in <code class="notranslate">pd.read_excel</code> seems not to behave properly when the first column name is missing (for example, when a file is written using <code class="notranslate">to_excel(..., index=True)</code>).</p>
<p dir="auto"><strong>Example 1</strong><br>
We end up with a DataFrame where the data for <code class="notranslate">col2</code> was originally the data below <code class="notranslate">col1</code>. This does not seem intuitive.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Original:
   col1 col2
0    a    x
1    b    y
Read:
    col1 col2
x     0    a
y     1    b"><pre class="notranslate"><code class="notranslate">Original:
   col1 col2
0    a    x
1    b    y
Read:
    col1 col2
x     0    a
y     1    b
</code></pre></div>
<p dir="auto"><strong>Example 2</strong><br>
It seems like the <code class="notranslate">index_col=None</code> option does not work. The first column  of the file is treated as the DataFrame index.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Original:
    col1 col2
i1    a    x
i2    b    y
Read:
    col1 col2
i1    a    x
i2    b    y
Index(['col1', 'col2'], dtype='object')"><pre class="notranslate"><code class="notranslate">Original:
    col1 col2
i1    a    x
i2    b    y
Read:
    col1 col2
i1    a    x
i2    b    y
Index(['col1', 'col2'], dtype='object')
</code></pre></div>
<h3 dir="auto">Expected Output</h3>
<p dir="auto"><strong>Example 1</strong><br>
If column names are not specified, I would expect the data assigned to <code class="notranslate">col1</code> to be that below <code class="notranslate">col1</code> in the original excel file (same for <code class="notranslate">col2</code>).  Something like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Read:
    col1 col2
x     a    x
y     b    y"><pre class="notranslate"><code class="notranslate">Read:
    col1 col2
x     a    x
y     b    y
</code></pre></div>
<p dir="auto"><strong>Example 2</strong><br>
I would expect the newly read tab to look somewhat like this (as is the case when doing the same operations using <code class="notranslate">write_csv</code> and <code class="notranslate">read_csv</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   Unnamed: 0 col1 col2
0           i1    a    x
1           i2    b    y"><pre class="notranslate"><code class="notranslate">   Unnamed: 0 col1 col2
0           i1    a    x
1           i2    b    y
</code></pre></div>
<h3 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h3>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.5.2.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 4.8.0-58-generic<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: fr_FR.UTF-8<br>
LOCALE: fr_FR.UTF-8</p>
<p dir="auto">pandas: 0.21.1<br>
pytest: 3.1.2<br>
pip: 9.0.1<br>
setuptools: 37.0.0<br>
Cython: 0.25.2<br>
numpy: 1.13.3<br>
scipy: 0.19.1<br>
pyarrow: None<br>
xarray: None<br>
IPython: 6.1.0<br>
sphinx: 1.6.3<br>
patsy: None<br>
dateutil: 2.6.1<br>
pytz: 2017.3<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: 2.6.2<br>
feather: None<br>
matplotlib: 2.0.2<br>
openpyxl: None<br>
xlrd: 1.0.0<br>
xlwt: 1.3.0<br>
xlsxwriter: 0.7.3<br>
lxml: None<br>
bs4: None<br>
html5lib: 0.999999999<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.9.6<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>