Skip to content

DOC: Improve the docstring of Timedelta.delta redux #21138

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 3 commits into from
May 21, 2018

Conversation

chalmerlowe
Copy link
Contributor

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

rather than trying to pick and choose items from my previous PR #21135 (which somehow had a number of other items sucked into it) ...
gonna start from scratch here and close out the old PR.

tried to incorporate changes noted in previous conversations with @WillAyd and @jreback (thanks for the guidance!)

################################################################################
###################### Docstring (pandas.Timedelta.delta) ######################
################################################################################

Return the timedelta in nanoseconds (ns), for internal compatibility.

Returns
-------
int
    Timedelta in nanoseconds.

Examples
--------
>>> td = pd.Timedelta('1 days 42 ns')
>>> td.delta
86400000000042

>>> td = pd.Timedelta('3 s')
>>> td.delta
3000000000

>>> td = pd.Timedelta('3 ms 5 us')
>>> td.delta
3005000

>>> td = pd.Timedelta(42, unit='ns')
>>> td.delta
42

################################################################################
################################## Validation ##################################
################################################################################

@codecov
Copy link

codecov bot commented May 20, 2018

Codecov Report

Merging #21138 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #21138   +/-   ##
=======================================
  Coverage   91.84%   91.84%           
=======================================
  Files         153      153           
  Lines       49499    49499           
=======================================
  Hits        45460    45460           
  Misses       4039     4039
Flag Coverage Δ
#multiple 90.23% <ø> (ø) ⬆️
#single 41.88% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc37ea2...e9348b6. Read the comment docs.

@mroeschke mroeschke added Docs Timedelta Timedelta data type labels May 20, 2018
@jreback jreback added this to the 0.23.1 milestone May 21, 2018
@jreback jreback merged commit 508ec3d into pandas-dev:master May 21, 2018
@jreback
Copy link
Contributor

jreback commented May 21, 2018

thanks!

1 similar comment
@jreback
Copy link
Contributor

jreback commented May 21, 2018

thanks!

jorisvandenbossche pushed a commit to jorisvandenbossche/pandas that referenced this pull request Jun 8, 2018
jorisvandenbossche pushed a commit that referenced this pull request Jun 9, 2018
david-liu-brattle-1 pushed a commit to david-liu-brattle-1/pandas that referenced this pull request Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants