Skip to content
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

DataFrame.to_csv sometimes ignores header argument #6880

Closed
marcua opened this issue Apr 14, 2014 · 3 comments
Closed

DataFrame.to_csv sometimes ignores header argument #6880

marcua opened this issue Apr 14, 2014 · 3 comments

Comments

@marcua
Copy link
Contributor

marcua commented Apr 14, 2014

Using PANDAS 0.13.1.

If you call DataFrame.to_csv with index=False and a header, the header doesn't replace the column names. With index=True, header correctly replaces the csv header.

The code behind this: https://github.com/pydata/pandas/blob/master/pandas/core/format.py#L1080

Presumably we want to replace cols with headers even in the else on line 1091.

Happy to take a stab at fixing this, but didn't know if I'm missing some interaction between the variables that makes this not a bug. Thanks!

@jreback
Copy link
Contributor

jreback commented Apr 15, 2014

pretty sure that their is an issue about this
care to find and link the issue?

@marcua marcua closed this as completed Apr 15, 2014
@marcua marcua reopened this Apr 15, 2014
@marcua
Copy link
Contributor Author

marcua commented Apr 15, 2014

Looks like it's this: #6186

Unsure how to mark this as a duplicate, but happy to tackle the solution if you agree it's a problem :)

@TomAugspurger
Copy link
Contributor

We can just close this one now that you've linked to the original.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants