-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Resolution docstring #21122
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
Resolution docstring #21122
Changes from 16 commits
4dcb4b4
e0ae113
11a9266
04e204b
5ac6ef1
fb45759
b0977f4
85bcb52
841611e
4237391
5035798
3de9d58
23a8aae
2c91847
83da2fe
764f91a
886f21a
5737c67
bf0def0
1d0d397
ce7c795
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -770,7 +770,53 @@ cdef class _Timedelta(timedelta): | |
|
||
@property | ||
def resolution(self): | ||
""" return a string representing the lowest resolution that we have """ | ||
""" | ||
Return a string representing the lowest (i.e. smallest) time | ||
resolution. | ||
|
||
Each timedelta has a defined resolution that represents the lowest OR | ||
most granular level of precision. Each level of resolution is | ||
represented by a short string as defined below: | ||
|
||
============ ============ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this will render in a doc-string, not really sure what the standard is for a table like list There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have a suggestion?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep that's prob ok |
||
Resolution Return value | ||
============ ============ | ||
Days 'D' | ||
Hours 'H' | ||
Minutes 'T' | ||
Seconds 'S' | ||
Milliseconds 'L' | ||
Microseconds 'U' | ||
Nanoseconds 'N' | ||
============ ============ | ||
|
||
Returns | ||
------- | ||
str | ||
Time resolution. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Time -> Timedelta |
||
|
||
Examples | ||
-------- | ||
**Using string input** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you don't need the 'Using string input' or numeric input section |
||
|
||
>>> td = pd.Timedelta('1 days 2 min 3 us 42 ns') | ||
>>> td.resolution | ||
'N' | ||
|
||
>>> td = pd.Timedelta('1 days 2 min 3 us') | ||
>>> td.resolution | ||
'U' | ||
|
||
>>> td = pd.Timedelta('2 min 3 s') | ||
>>> td.resolution | ||
'S' | ||
|
||
**Using integer input** | ||
|
||
>>> td = pd.Timedelta(36, unit='us') | ||
>>> td.resolution | ||
'U' | ||
""" | ||
|
||
self._ensure_components() | ||
if self._ns: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be a single line