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

ENH: format parameter in DataFrame.to_csv #1525

Closed
andreas-h opened this issue Jun 25, 2012 · 4 comments
Closed

ENH: format parameter in DataFrame.to_csv #1525

andreas-h opened this issue Jun 25, 2012 · 4 comments
Labels
Enhancement IO Data IO issues that don't fit into a more specific label
Milestone

Comments

@andreas-h
Copy link
Contributor

It would be good if the DataFrame.to_csv method would support specifying the string format to use.

@changhiskhan
Copy link
Contributor

Can you be more specific about what you'd like DataFrame.to_csv to be able to do? A short mock example would be really helpful.

@andreas-h
Copy link
Contributor Author

something along the lines of

df = [[0.123456, 0.234567, 0.567567], [12.32112, 123123.2, 321321.2]]
df.to_csv(filename, fmt='%.2g', sep=';')

yields

0.12;0.23;0.57
...

alternatively, the fmt parameter from to_string would be helpful, as well.

@changhiskhan
Copy link
Contributor

Make sense. Thanks.

@ghost ghost assigned changhiskhan Jul 23, 2012
@changhiskhan
Copy link
Contributor

I added a float_format keyword argument to to_csv and to_excel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

No branches or pull requests

2 participants