Skip to content

Date formatting option in to_csv? #2583

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
wesm opened this issue Dec 22, 2012 · 6 comments · Fixed by #4313
Closed

Date formatting option in to_csv? #2583

wesm opened this issue Dec 22, 2012 · 6 comments · Fixed by #4313
Labels
Enhancement IO CSV read_csv, to_csv IO Data IO issues that don't fit into a more specific label Output-Formatting __repr__ of pandas objects, to_string
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Mar 21, 2013

can easily support in new to_csv via say date_format (as the DatetimeBlock can handle analagously to float_float by the FloatBlock), pushing to 0.12

Also should add a couple of methods (in format.py?) to handle the various cases for passed formatters

e.g.
%.2f
lambda x: "mycool float: %.2f" % x

@ghost
Copy link

ghost commented Mar 21, 2013

This needs to be uniform across all IO apis, and flexible enough.

For example, float_format doesn't support new style python formatting
(no thousands seperator for example). Formatters is a better concept,
but not as concise.

We need to find a better way to this.

fwiw, modifying the frame and then exporting is actually a nicer
seperation of concerns. formatting arguably doesn't belong in
to_csv.

@jreback
Copy link
Contributor

jreback commented Mar 21, 2013

easy enough to have a class that can accept multiple input types (new style formatting,old as strings lambdas), then provide an api to the funcs that need it

@ghost
Copy link

ghost commented Mar 21, 2013

yeah, I'm for doing the formatting as a seperate stage using a delegate class,
and then having IOs use that across the lib. not sure how that would work.
0.13?

@jreback
Copy link
Contributor

jreback commented May 16, 2013

also need a top-level option for nat_rep='NaT' (for putting NaT) instead of an empty string

@jreback
Copy link
Contributor

jreback commented Sep 28, 2013

closing in favor of master issue #4668

@jreback jreback closed this as completed Sep 28, 2013
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 IO Data IO issues that don't fit into a more specific label Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants