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

Comments

@andreas-h
Copy link
Contributor

commented Jun 25, 2012

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

@changhiskhan

This comment has been minimized.

Copy link
Contributor

commented Jun 25, 2012

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

This comment has been minimized.

Copy link
Contributor Author

commented Jun 25, 2012

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

This comment has been minimized.

Copy link
Contributor

commented Jun 25, 2012

Make sense. Thanks.

@ghost ghost assigned changhiskhan Jul 23, 2012

@changhiskhan

This comment has been minimized.

Copy link
Contributor

commented Aug 20, 2012

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
Projects
None yet
2 participants
You can’t perform that action at this time.