Open stevecj opened 4 years ago
Suggested pattern:
Pass False
as the value to date_format
and/or datetime_format
to indicate that the formats for columns of those types should not be set automatically.
I think this would be a logical enhancement - interested in submitting a pull request @stevecj ?
I haven't worked on Pandas source before, but I'll certainly give it a shot.
Short on time. Still plan to try making this enhancement at some point if nobody beats me to it.
If @stevecj isn't working on it, I would want to take it.
go ahead, thanks @shraddhazpy
take
Suggested pattern:
Pass
False
as the value todate_format
and/ordatetime_format
to indicate that the formats for columns of those types should not be set automatically.
@MarcoGorelli just wanted to ensure that this is the pattern to be followed.
Looks like it - I think the suggestion is to make something analogous to float_format
, but for dates
When exporting to Excel, it is possible to add multiple number formats and then use
set_column
to apply any desired numeric format to any column. Attempting to do the same for date or date-time columns has no effect however.It is possible to set a format for all date columns or all date-time columns using the
date_format
anddatetime_format
arguments toExcelWriter()
, but that applies a single format to all dates and a single format to all date-time values.In my particular case, I have a column that is intended to represent a whole month, and I want to format it as such in the exported data, and I have other date columns that represent specific dates. There is apparently no way to accomplish that. Why?
Why not simply allow applying date formats to columns just as one can apply numeric formats to columns?