Skip to content

Conversation

@loicdiridollou
Copy link
Member

Returns
-------
timedelta64 or numpy.array of timedelta64
Timedelta or TimedeltaIndex of timedelta64
Copy link
Member

Choose a reason for hiding this comment

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

This can also return a Series of timedelta64[ns] if a Series is the input.

Would be great if you could organize this Returns sections like the Returns section of to_datetime

@mroeschke mroeschke added Docs Timedelta Timedelta data type labels Nov 23, 2021
- list-like: TimedeltaIndex of timedelta64 dtype
- Series: Series of timedelta64 dtype
- Timedelta: Timedelta
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Could you summarize this and line below as - scalar: Timedelta. scalar includes str, datetime.timedelta, np.timedelta64, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! I wasn't sure at first that Timedelta was considered a scalar but should have checked with pandas.api.types.is_scalar, my mistake, it is fixed

@mroeschke mroeschke merged commit fb86932 into pandas-dev:master Nov 24, 2021
@mroeschke
Copy link
Member

Thanks @loicdiridollou! Awesome job. Happy to have more of these doc issues addressed!

@loicdiridollou loicdiridollou deleted the timedelta_doc branch November 25, 2021 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs Timedelta Timedelta data type

2 participants