question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Timestamp.resolution returns timedelta(microseconds=1)

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mroeschkecommented, Jun 7, 2018

@drewmassey your snippet is looking at timedeltas.pyx (which has a relevant resolution issue open #21344). This issue would entail adding a resolution property to timestamp.pyx

0reactions
drewmasseycommented, Jun 7, 2018

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found