Skip to content

to_html() formatters does not work for objects with 'datetime64[ns]' type #10690

Closed
@shishirsharma

Description

@shishirsharma

I am using a to_html() to convert a dataframe into a table. i have various datatypes in Dataframe including float, int, datetime and timedelta.

I am using formatters to control outputs, It seems to be working for int and float but not for datetime.

datetime_formatter = lambda ts: "%s" % ts.strftime("%I:%M %p")
currency_formatter = lambda cash: "%.2f" % cash

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypeIO HTMLread_html, to_html, Styler.apply, Styler.applymap

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions