-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Add examples for pandas.tseries.timedeltas #11785
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
DOC: Add examples for pandas.tseries.timedeltas #11785
Conversation
@@ -32,6 +32,20 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise', coerce=None): | |||
Returns | |||
------- | |||
ret : timedelta64/arrays of timedelta64 if parsing succeeded | |||
|
|||
Examples | |||
-------- |
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.
You did something strange with the indentation here
@proinsias Thanks a lot for working on examples in docstrings! Besides the inline comments, another general: maybe it would be nice to have some text between the different examples to somehow put them a bit into context, eg:
|
Thanks for the advice! – I've made these changes and re-pushed the branch. |
-------- | ||
|
||
Parsing a single string to a Timedelta: | ||
>>> pd.to_timedelta('1 days 06:05:01.00003') |
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.
Small formatting note: there needs to be a blank line between the two lines above (between the code blocks and the text, so the code blocks are rendered as code, see https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#sections for a full reference)
Copied examples from pandas-docs/stable/timedeltas.html.
DOC: Add examples for pandas.tseries.timedeltas
thanks! |
Copied examples from the reStructuredText tutorial on timedeltas.