Skip to content

DOC: updated docstring for nanoseconds function per doc guidelines #21065

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 10 commits into from
May 17, 2018
11 changes: 9 additions & 2 deletions pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,16 @@ cdef class _Timedelta(timedelta):
@property
def nanoseconds(self):
"""
Number of nanoseconds (>= 0 and less than 1 microsecond).
Return the number of nanoseconds (n), where 0 <= n < 1 microsecond.

Returns
-------
int : Number of nanoseconds
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the type and description on separate lines. Make sure you indent the description and add a period at the end of it.


.components will return the shown components
See Also
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a reference to the other component attributes

--------
Timedelta.components : Return all attributes with assigned values (i.e.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a period at the end of the description here. This isn't enforced and is inconsistent in the docs but should eventually be standardized

days, seconds, microseconds, nanoseconds)
"""
self._ensure_components()
return self._ns
Expand Down