<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# for example, index should be accepted, like so:
df.to_parquet( 'my_parquet_file.parquet', compression='gzip', index=False )"><pre class="notranslate"><span class="pl-c"># for example, index should be accepted, like so:</span>
<span class="pl-s1">df</span>.<span class="pl-en">to_parquet</span>( <span class="pl-s">'my_parquet_file.parquet'</span>, <span class="pl-s1">compression</span><span class="pl-c1">=</span><span class="pl-s">'gzip'</span>, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-c1">False</span> )</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">[this should explain <strong>why</strong> the current behaviour is a problem and why the expected output is a better solution.]</p>
<p dir="auto"><strong>Note</strong>: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!</p>
<p dir="auto"><strong>Note</strong>: Many problems can be resolved by simply upgrading <code class="notranslate">pandas</code> to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if <code class="notranslate">master</code> addresses this issue, but that is not necessary.</p>
<p dir="auto">For documentation-related issues, you can check the latest versions of the docs on <code class="notranslate">master</code> here:</p>
<p dir="auto"><a href="https://pandas-docs.github.io/pandas-docs-travis/" rel="nofollow">https://pandas-docs.github.io/pandas-docs-travis/</a></p>
<p dir="auto">If the issue has not been resolved there, go ahead and file it in the issue tracker.</p>
<h4 dir="auto">Expected Output</h4>
<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.4.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 3.16.0-77-generic<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: None<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.22.0<br>
pytest: 3.2.5<br>
pip: 9.0.1<br>
setuptools: 39.0.1<br>
Cython: 0.28.1<br>
numpy: 1.14.2<br>
scipy: 0.19.1<br>
pyarrow: None<br>
xarray: None<br>
IPython: 6.2.1<br>
sphinx: 1.7.2<br>
patsy: 0.5.0<br>
dateutil: 2.7.2<br>
pytz: 2018.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: 2.5.1<br>
xlrd: 1.0.0<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: 4.2.1<br>
bs4: 4.6.0<br>
html5lib: 0.999999999<br>
sqlalchemy: 1.2.5<br>
pymysql: None<br>
psycopg2: 2.7.4 (dt dec pq3 ext lo64)<br>
jinja2: 2.10<br>
s3fs: None<br>
fastparquet: 0.1.4<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details>
<p dir="auto">I'm using pandas 0.17.1</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
  pd.__version__"><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-s1">__version__</span></pre></div>
<p dir="auto"><code class="notranslate">Out:'0.17.1'</code></p>
<p dir="auto">When column names are duplicated</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="cols = ['A', 'A', 'B']
with open('pandas.csv', 'w') as f:
  f.write('1,2,3')"><pre class="notranslate"><span class="pl-s1">cols</span> <span class="pl-c1">=</span> [<span class="pl-s">'A'</span>, <span class="pl-s">'A'</span>, <span class="pl-s">'B'</span>]
<span class="pl-k">with</span> <span class="pl-en">open</span>(<span class="pl-s">'pandas.csv'</span>, <span class="pl-s">'w'</span>) <span class="pl-k">as</span> <span class="pl-s1">f</span>:
  <span class="pl-s1">f</span>.<span class="pl-en">write</span>(<span class="pl-s">'1,2,3'</span>)</pre></div>
<p dir="auto">we can still load dataframe</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pd.read_csv('pandas.csv',
            header=None,
            names=cols,
           )"><pre class="notranslate"><span class="pl-s1">pd</span>.<span class="pl-en">read_csv</span>(<span class="pl-s">'pandas.csv'</span>,
            <span class="pl-s1">header</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
            <span class="pl-s1">names</span><span class="pl-c1">=</span><span class="pl-s1">cols</span>,
           )</pre></div>
<p dir="auto">with explainable behaviour</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Out:
     A    A    B
0    2    2    3"><pre class="notranslate"><code class="notranslate">Out:
     A    A    B
0    2    2    3
</code></pre></div>
<p dir="auto">Then we might want to load some of the columns with python engine</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pd.read_csv('pandas.csv',
            engine='python',
            header=None,
            names=cols,
            usecols=cols
           )"><pre class="notranslate"><span class="pl-s1">pd</span>.<span class="pl-en">read_csv</span>(<span class="pl-s">'pandas.csv'</span>,
            <span class="pl-s1">engine</span><span class="pl-c1">=</span><span class="pl-s">'python'</span>,
            <span class="pl-s1">header</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
            <span class="pl-s1">names</span><span class="pl-c1">=</span><span class="pl-s1">cols</span>,
            <span class="pl-s1">usecols</span><span class="pl-c1">=</span><span class="pl-s1">cols</span>
           )</pre></div>
<p dir="auto">and get different but still explainable result</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Out:
     A    B
0    1    3"><pre class="notranslate"><code class="notranslate">Out:
     A    B
0    1    3
</code></pre></div>
<p dir="auto">But then we switch back to c-engine</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pd.read_csv('pandas.csv',
            engine='c',
            header=None,
            names=cols,
            usecols=cols
           )"><pre class="notranslate"><span class="pl-s1">pd</span>.<span class="pl-en">read_csv</span>(<span class="pl-s">'pandas.csv'</span>,
            <span class="pl-s1">engine</span><span class="pl-c1">=</span><span class="pl-s">'c'</span>,
            <span class="pl-s1">header</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
            <span class="pl-s1">names</span><span class="pl-c1">=</span><span class="pl-s1">cols</span>,
            <span class="pl-s1">usecols</span><span class="pl-c1">=</span><span class="pl-s1">cols</span>
           )</pre></div>
<p dir="auto">and get the following</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Out:
     A    A    B
0    2    2    NaN"><pre class="notranslate"><code class="notranslate">Out:
     A    A    B
0    2    2    NaN
</code></pre></div>
<p dir="auto">which is:<br>
(a) different (which is not good in my opinion)<br>
(b) looks like bug</p>