ENH: support for non-nanosecond precision in pd.Timedelta #59389
Labels
Closing Candidate
May be closeable, needs more eyeballs
Enhancement
Non-Nano
datetime64/timedelta64 with non-nanosecond resolution
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
When converting matlab datenums, I would expect this should be easily possible with
pd.Timedelta()
, however, several approaches give different errors:I expect this is because of the nanosecond accuracy. Matlab dates are in days (dtype float) and I would be happy with microsecond (or less) precision.
pd.date_range()
andpd.Timestamp()
now support non-nanosecond accuracy. Would this also be possible withpd.Timedelta()
?Feature Description
Add support for non-nanosecond accuracy for
pd.Timedelta()
Alternative Solutions
It is possible to convert matlab datenums to pandas datetimes with the following approach from https://stackoverflow.com/a/49135037/5578371:
Gives:
DatetimeIndex(['1987-01-01'], dtype='datetime64[ns]', freq=None)
Additional Context
No response
The text was updated successfully, but these errors were encountered: