-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
to_html() formatters does not work for objects with 'datetime64[ns]' type #10690
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
Comments
pls show a small but minimally reproducible example, along with |
I encountered the same problem, and then did some digging. The issue is reproduced with the following example.
this prints:
As you can see, the dates are not formatted using the specified function. The class
I propose to change method
to
Here's the output of
|
- [x] closes pandas-dev#10690 - [x] tests added / passed - [x] passes ``git diff upstream/master | flake8 --diff`` - [x] whatsnew entry the Datetime64Formatter class did not accept a `formatter` argument, so custom formatters passed in through `df.to_string` or `df.to_html` were silently ignored. Author: Haleemur Ali <[email protected]> This patch had conflicts when merged, resolved by Committer: Joris Van den Bossche <[email protected]> Closes pandas-dev#13567 from haleemur/fix/dt64_outputformat and squashes the following commits: 8d84283 [Haleemur Ali] fix bug in Datetime64Formatter, which affected custom date formatted output for df.to_string, df.to_html methods
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.
The text was updated successfully, but these errors were encountered: