Skip to content

API: Timedelta constructor pytimedelta, Tick preserve reso #48918

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
merged 11 commits into from
Oct 8, 2022

Conversation

jbrockmendel
Copy link
Member

Sits on top of #48910

@jbrockmendel
Copy link
Member Author

@mroeschke getting this and/or the astype one in would let me have a productive weekend

@@ -1706,7 +1707,13 @@ class Timedelta(_Timedelta):
value = parse_timedelta_string(value)
value = np.timedelta64(value)
elif PyDelta_Check(value):
value = convert_to_timedelta64(value, 'ns')
# pytimedelta object -> microsecond resolution
Copy link
Member

Choose a reason for hiding this comment

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

When the non-nano resolution docs are written, might be good to mention that datetime.timedeltas now default to microsecond resolution?

@mroeschke mroeschke added this to the 1.6 milestone Oct 8, 2022
@mroeschke mroeschke merged commit ac05d29 into pandas-dev:main Oct 8, 2022
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the nano-tdelta-constructor-2 branch October 9, 2022 14:57
@mroeschke mroeschke modified the milestones: 1.6, 2.0 Oct 13, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
…v#48918)

* BUG: Timedelta.__new__

* remove assertion

* GH refs

* API: Timedelta(td64_obj) retain resolution

* API: Timedelta constructor pytimedelta, Tick preserve reso

* remove debugging variable

* remove duplicate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frequency DateOffsets Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants