-
Notifications
You must be signed in to change notification settings - Fork 65
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
ipyvega doesn't handle date values in pandas #70
Comments
Is this still an issue? Do you have example code that reproduces the error? Thanks! |
Please reopen if this is still an issue. |
This is still an issue. Please reopen:
results in:
|
Thanks for the example. Can you send a PR to fix this? |
Not to argue, but this seems like a bug, not an enhancement, since date(), datetime() and time() objects are pretty common in pandas frames. I wouldn't know the best way to render dates for consumption by Vega, so I'm not going to try at a PR for this. You probably want to use to_json(orient="index") on the frame, but that returns integer values that javascript is going to need to parse.
produces:
|
I think the title of this issue is wrong. We already support datetime, but not date. See Line 69 in eab0c42
|
Vega can read dates as standard strings (as supported by browsers) and timestamps. |
Some database queries return python date objects in pandas frames call
pd.read_sql
. Pandas generally knows how to deal with this, for example, when displaying a table, it formats the date correctly.However, if this frame is passed to ipyvega
VegaLite(spec, df )
VegaLite throws an error complaining that it doesn't understand the datetime object. I think ipyvega should be able to understand the python datetime object.The text was updated successfully, but these errors were encountered: