Skip to content

DOC: Timedelta constructor requires value or keyword args - not specified in the docs #45258

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

Closed
1 task done
Dr-Irv opened this issue Jan 8, 2022 · 1 comment
Closed
1 task done
Assignees
Labels
Milestone

Comments

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Jan 8, 2022

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on master here

Location of the documentation

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Timedelta.html

Documentation problem

The Timedelta constructor requires specifying either value or keyword arguments, but the docs seem to imply that value and unit are required. The following shows two equivalent calls for a one day increment:

pd.Timedelta(1, "d") == pd.Timedelta(days=1)

Suggested fix for documentation

The docs should indicate that you specify either value and unit OR kwargs, and at least value or kwargs must be specified.

@Pydare
Copy link
Contributor

Pydare commented Jan 8, 2022

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants