Skip to content

GH9570 allow timedelta string conversion without leading zero #9868

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

Conversation

chrisgilmerproj
Copy link
Contributor

See #9570

This commit allows for the Timedelta class to take a construction like Timedelta('0:00:00') or Timedelta('00:00:00').

@jreback jreback added Enhancement Timedelta Timedelta data type labels Apr 13, 2015
@jreback jreback added this to the 0.16.1 milestone Apr 13, 2015
@chrisgilmerproj
Copy link
Contributor Author

@TomAugspurger
Copy link
Contributor

Could you add a release note in doc/source/whatsnew/v0.16.1?

@chrisgilmerproj
Copy link
Contributor Author

Yep, will do!

@chrisgilmerproj
Copy link
Contributor Author

@chrisgilmerproj
Copy link
Contributor Author

This now supports the following:

In [1]: from pandas import Timedelta; Timedelta('-01:00:00')
Out[1]: Timedelta('-1 days +23:00:00')

In [2]: from pandas import Timedelta; Timedelta('-1:00:00')
Out[2]: Timedelta('-1 days +23:00:00')

In [3]: from pandas import Timedelta; Timedelta('00:00:00')
Out[3]: Timedelta('0 days 00:00:00')

In [4]: from pandas import Timedelta; Timedelta('0:00:00')
Out[4]: Timedelta('0 days 00:00:00')

@chrisgilmerproj chrisgilmerproj force-pushed the timedelta_string_conversion branch from 84b26b1 to 0a1e22b Compare April 13, 2015 16:06
@chrisgilmerproj
Copy link
Contributor Author

All right, tests have passed @TomAugspurger @jreback

@TomAugspurger
Copy link
Contributor

Looks good to me. I'll let @jreback handle the merges today (unless he says otherwise).

jreback added a commit that referenced this pull request Apr 13, 2015
…sion

GH9570 allow timedelta string conversion without leading zero
@jreback jreback merged commit 9d9fa24 into pandas-dev:master Apr 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants