-
-
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
Merged
Merged
Resolution docstring #21122
Changes from 13 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4dcb4b4
updated docstring for nanoseconds function
chalmerlowe e0ae113
Merge remote-tracking branch 'upstream/master' into nanosecond-docstring
chalmerlowe 11a9266
DOC: updated docstring for nanoseconds function per doc guidelines
chalmerlowe 04e204b
DOC: added examples to nanoseconds function and minor formatting edits
chalmerlowe 5ac6ef1
DOC: added example header
chalmerlowe fb45759
DOC: added example header and space
chalmerlowe b0977f4
DOC: fixed minor spelling error
chalmerlowe 85bcb52
removed trailing whitespace, long lines
chalmerlowe 841611e
Merge remote-tracking branch 'upstream/master' into nanosecond-docstring
chalmerlowe 4237391
DOC: updates to docstring for nanoseconds function per doc guidelines
chalmerlowe 5035798
DOC: documentation guide update to resolution docstring
chalmerlowe 3de9d58
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
chalmerlowe 23a8aae
DOC: Improve docstring of Timedelta.resolution
chalmerlowe 2c91847
DOC: Improve docstring of Timedelta.resolution
chalmerlowe 83da2fe
DOC: Improve the docstring of Timedelta.resolution
chalmerlowe 764f91a
DOC: Improve the docstring of Timedelta.resolution
chalmerlowe 886f21a
Minor edits as suggested
chalmerlowe 5737c67
DOC: Improve the docstring of Timedelta.resolution
chalmerlowe bf0def0
Merge remote-tracking branch 'upstream/master' into resolution-docstring
chalmerlowe 1d0d397
Merge remote-tracking branch 'upstream/master' into resolution-docstring
ce7c795
remove whitespace
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -770,7 +770,60 @@ 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: | ||
|
||
============ ============ | ||
Resolution Return value | ||
============ ============ | ||
Days 'D' | ||
Hours 'H' | ||
Minutes 'T' | ||
Seconds 'S' | ||
Milliseconds 'L' | ||
Microseconds 'U' | ||
Nanoseconds 'N' | ||
============ ============ | ||
|
||
- 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: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a suggestion?
Do bulleted lists work?
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.
yep that's prob ok