Skip to content

to_csv ignoring index=False (v0.22.0 only) #20739

@morganbye

Description

@morganbye

Code Sample, a copy-pastable example if possible

            df.to_csv(output_path,
                       sep='\t',
                       header=False,
                       index=False,
                       float_format='%d'
                       )

Problem description

In Pandas v0.19 and 0.20 the above code would result in a tab-separated file, without an index column.

In v0.22 the index column is printed regardless of the index flag.

Expected Output

.tsv file without index column

Output of pd.show_versions()

Details INSTALLED VERSIONS ------------------ commit: None python: 2.7.11.final.0 python-bits: 64 OS: Linux OS-release: 2.6.32-573.26.1.el6.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_CA.UTF-8 LOCALE: None.None

pandas: 0.22.0
pytest: None
pip: 10.0.0
setuptools: 38.5.1
Cython: 0.28.2
numpy: 1.14.2
scipy: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.7.0
pandas_gbq: None
pandas_datareader: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions