Skip to content

Write CSV without index as default #12627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jpotts18 opened this issue Mar 14, 2016 · 2 comments
Closed

Write CSV without index as default #12627

jpotts18 opened this issue Mar 14, 2016 · 2 comments
Labels
API Design IO CSV read_csv, to_csv

Comments

@jpotts18
Copy link

Code Sample, a copy-pastable example if possible

Most of the time when I write a csv to file I don't need the index in the CSV output. I end up writing to_csv('file/path.csv', index=False) basically everytime. I am wondering if Index=False should be the default.

Expected Output

pd.to_csv('file/path.csv')

output of pd.show_versions()

commit: None
python: 2.7.10.final.0
python-bits: 64
OS: Darwin
OS-release: 15.0.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.17.1
nose: 1.3.7
pip: 7.1.2
setuptools: 1.1.6
Cython: None
numpy: 1.10.4
scipy: 0.17.0
statsmodels: None
IPython: 4.0.0
sphinx: None
patsy: None
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.0
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.4.1
html5lib: 1.0b8
httplib2: 0.9.2
apiclient: None
sqlalchemy: 1.0.10
pymysql: None
psycopg2: None
Jinja2: None

@jreback
Copy link
Contributor

jreback commented Mar 14, 2016

Has been this way almost since the beginning.

The idea is that .to_csv and .from_csv are inverses

Essentially impossible to change at this point. But to be honest its actually a sensible default. Indexes are more and more important. If you are not using them you should.

@jreback jreback closed this as completed Mar 14, 2016
@jreback jreback added API Design IO CSV read_csv, to_csv labels Mar 14, 2016
@jpotts18
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design IO CSV read_csv, to_csv
Projects
None yet
Development

No branches or pull requests

2 participants