Timestamp.resolution returns timedelta(microseconds=1)
See original GitHub issueI hadn’t even noticed that resolution
was a datetime
property until now, but it returns timedelta(0, 0, 1)
. Timestamp
doesn’t override that. I expect the correct thing to do is to return Timedelta(nanoseconds=1)
. Pretty low priority.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
datetime — Basic date and time types — Python 3.11.1 ...
class datetime.timedelta. A duration expressing the difference between two date , time , or datetime instances to microsecond resolution.
Read more >Format timedelta to string - python - Stack Overflow
It takes the number of seconds and returns a datetime that can be formatted like any other datetime . duration = datetime.utcfromtimestamp(end -...
Read more >5 Cold Knowledge Points About Python Timedelta
However, we need to know that the resolution of timedelta is microseconds. This means that we cannot use timedelta to handle nanoseconds.
Read more >Timestamp and microseconds on Windows platforms
The datetime.datetime object can return the current date and time with a resolution up to microseconds which is true on *nix platforms but ......
Read more >pandas.Timedelta — pandas 1.5.2 documentation
Return a numpy.timedelta64 object with 'ns' precision. total_seconds. Total seconds in the duration.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@drewmassey your snippet is looking at
timedeltas.pyx
(which has a relevant resolution issue open #21344). This issue would entail adding a resolution property totimestamp.pyx
So I’m looking at https://github.com/pandas-dev/pandas/blob/9d61ab5aae0dd4ca3f805275c6a8ebcaeef77d64/pandas/_libs/tslibs/timedeltas.pyx#L797 and I think fixing this would be breaking change … it isn’t hard to change the return values but is that really the desired behavior?