Skip to content

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

Closed
@Dr-Irv

Description

@Dr-Irv

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions