-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: HDFStore doesn't save datetime64[s] right #59004
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
caballerofelipe
added a commit
to caballerofelipe/simple_portfolio_ledger
that referenced
this issue
Jun 13, 2024
…s]`. Some testing was done and a bug was filed, HDF5Store doesn't save or loads `datetime64[s]` right so it was changed to [ns] which is the format Pandas chooses when transforming to datetime. See the link for the bug: pandas-dev/pandas#59004 .
5 tasks
I think this is a bug in Just for reference, here is a trace stack I used for debugging the reproducible code:
|
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
When saving to a file using .h5 (HDF5 format), if a column is of type
datetime64[s]
(s not ns) and then loading the file, the date isn't loaded correctly. My intuition tells me that the file gets saved todatetime64[s]
but when read Pandas parses the date asdatetime64[ns]
and I guess some more digits should be present if parsing todatetime64[ns]
. I haven't done any tests with other datetime precisions.Expected Behavior
When saving a
datetime64[s]
to HDF5 file format and loading that file, the date should be correctly loaded.Installed Versions
The text was updated successfully, but these errors were encountered: