Skip to content

DOC: timedelta return type #42316

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
max-sixty opened this issue Jun 30, 2021 · 1 comment · Fixed by #44592
Closed

DOC: timedelta return type #42316

max-sixty opened this issue Jun 30, 2021 · 1 comment · Fixed by #44592
Labels
Docs Timedelta Timedelta data type
Milestone

Comments

@max-sixty
Copy link
Contributor

Location of the documentation

https://github.com/pandas-dev/pandas/blob/master/pandas/core/tools/timedeltas.py#L70

Documentation problem

Is numpy.array of timedelta64 the correct return time for to_timedelta? I see it here as TimedeltaIndex: https://github.com/pandas-dev/pandas/blob/master/pandas/tests/indexes/timedeltas/test_timedelta.py#L27

@max-sixty max-sixty added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 30, 2021
@mroeschke mroeschke added Timedelta Timedelta data type and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 21, 2021
@loicdiridollou
Copy link
Contributor

Hey @max-sixty,
I looked at it and indeed it does not return a numpy.array, it will either be a TimedeltaIndex as in the following case pd.to_timedelta(np.arange(5), unit='d') or Timedelta (from pandas._libs.tslibs.timedeltas.Timedelta) in the following case pd.to_timedelta("15.5us") (when passing just a string it seems)
I have opened a PR to update the docs.
Have a good day!

@mroeschke mroeschke added this to the 1.4 milestone Nov 24, 2021
mroeschke pushed a commit that referenced this issue Nov 24, 2021
* DOC: change return type #42316

* DOC: updating docstring

* Doc changing the Returns docstring to adhere to to_datetime structure

* DOC: combining types
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 a pull request may close this issue.

3 participants