<p dir="auto">If using MultiIndex as columns, saving to CSV adds an extra line with no data between the column headers and the data. I couldn't find information that this is something that should happen so it was unexpected to me.</p>
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<p dir="auto">In IPython:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
pd.DataFrame({('a','b'): [1, 2], ('c','d'): [3, 4]}).to_csv('temp.csv', index=False)
cat temp.csv"><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">pd</span>.<span class="pl-v">DataFrame</span>({(<span class="pl-s">'a'</span>,<span class="pl-s">'b'</span>): [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>], (<span class="pl-s">'c'</span>,<span class="pl-s">'d'</span>): [<span class="pl-c1">3</span>, <span class="pl-c1">4</span>]}).<span class="pl-en">to_csv</span>(<span class="pl-s">'temp.csv'</span>, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)
<span class="pl-s1">cat</span> <span class="pl-s1">temp</span>.<span class="pl-s1">csv</span></pre></div>
<p dir="auto">Outputs:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="a,c
b,d
,
1,3
2,4"><pre class="notranslate"><code class="notranslate">a,c
b,d
,
1,3
2,4
</code></pre></div>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">I expected not to have an empty row between column names and the data:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="a,c
b,d
1,3
2,4"><pre class="notranslate"><code class="notranslate">a,c
b,d
1,3
2,4
</code></pre></div>
<h4 dir="auto">output of <code class="notranslate">pd.show_versions()</code></h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="INSTALLED VERSIONS
------------------
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Linux
OS-release: 4.5.2-gnu-1
machine: x86_64
processor: 
byteorder: little
LC_ALL: None
LANG: en_DK.UTF-8

pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.10.1
Cython: 0.24
numpy: 1.11.0
scipy: 0.17.0
statsmodels: None
xarray: None
IPython: 4.2.0
sphinx: 1.4
patsy: None
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.5.2
matplotlib: 1.5.1
openpyxl: None
xlrd: 0.9.4
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.4.1
html5lib: None
httplib2: 0.9.2
apiclient: 1.5.0
sqlalchemy: 1.0.12
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: None"><pre class="notranslate"><code class="notranslate">INSTALLED VERSIONS
------------------
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Linux
OS-release: 4.5.2-gnu-1
machine: x86_64
processor: 
byteorder: little
LC_ALL: None
LANG: en_DK.UTF-8

pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.10.1
Cython: 0.24
numpy: 1.11.0
scipy: 0.17.0
statsmodels: None
xarray: None
IPython: 4.2.0
sphinx: 1.4
patsy: None
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.5.2
matplotlib: 1.5.1
openpyxl: None
xlrd: 0.9.4
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.4.1
html5lib: None
httplib2: 0.9.2
apiclient: 1.5.0
sqlalchemy: 1.0.12
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: None
</code></pre></div>
<p dir="auto">This seems strange to me, but I don't often use a MultiIndex so I might be missing something obvious.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; pd.__version__
'0.13.1-420-g6899ed6'
&gt;&gt;&gt; df2 = pd.DataFrame([1], columns=pd.MultiIndex.from_arrays([[1],[2]]))
&gt;&gt;&gt; df2
   1
   2
0  1

[1 rows x 1 columns]
&gt;&gt;&gt; df2.columns
MultiIndex(levels=[[1], [2]],
           labels=[[0], [0]])
&gt;&gt;&gt; print df2.to_csv()
,1
,2
,
0,1"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; pd.__version__
'0.13.1-420-g6899ed6'
&gt;&gt;&gt; df2 = pd.DataFrame([1], columns=pd.MultiIndex.from_arrays([[1],[2]]))
&gt;&gt;&gt; df2
   1
   2
0  1

[1 rows x 1 columns]
&gt;&gt;&gt; df2.columns
MultiIndex(levels=[[1], [2]],
           labels=[[0], [0]])
&gt;&gt;&gt; print df2.to_csv()
,1
,2
,
0,1
</code></pre></div>
<p dir="auto">Is there supposed to be that empty line at the end of the header?  Compare</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; print df2.to_csv(header=False)
0,1"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; print df2.to_csv(header=False)
0,1
</code></pre></div>