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

df.to_csv should mirror df.to_html #6061

Closed
filmor opened this issue Jan 24, 2014 · 5 comments · Fixed by #6406
Closed

df.to_csv should mirror df.to_html #6061

filmor opened this issue Jan 24, 2014 · 5 comments · Fixed by #6406
Labels
Enhancement IO CSV read_csv, to_csv Output-Formatting __repr__ of pandas objects, to_string
Milestone

Comments

@filmor
Copy link
Contributor

filmor commented Jan 24, 2014

If no path_or_buf argument is given DataFrame.to_csv should return a string.

@jreback
Copy link
Contributor

jreback commented Jan 24, 2014

hah....we've had many discussions about this....its actually a bad API @y-p !

use a StringIO(data) if you want to do this

@jreback jreback closed this as completed Jan 24, 2014
@jreback jreback reopened this Jan 24, 2014
@jreback
Copy link
Contributor

jreback commented Jan 24, 2014

@filmor sorry thought you were talking about to_csv.....yes..marking this an an enhancement...

PR's are welcome

@jreback
Copy link
Contributor

jreback commented Jan 24, 2014

you can of course just pass a StringIO here as well...eg.

buf=StringIO()
df.to_csv(buf, ....)

then buf.getvalue() is your string

@filmor
Copy link
Contributor Author

filmor commented Jan 24, 2014

I know, this was more about removing one small api-wtf ;)
I'll look into making a PR this weekend.

@jreback
Copy link
Contributor

jreback commented Feb 18, 2014

@filmor PR for this?

@jreback jreback modified the milestones: 0.15.0, 0.14.0 Feb 18, 2014
@jreback jreback modified the milestones: 0.14.0, 0.15.0 Mar 1, 2014
filmor added a commit to filmor/pandas that referenced this issue Mar 9, 2014
gouthambs pushed a commit to gouthambs/pandas that referenced this issue Mar 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement IO CSV read_csv, to_csv Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants