Skip to content

ENH: allow astype conversions for timedeltas to other timedelta freqs (still returns a float series), related to GH4521 #5305

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 1 commit into from
Oct 24, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Oct 23, 2013

related #4521

In [4]: td = pd.to_timedelta([0,1,2],unit='D')

In [5]: td
Out[5]: 
0           00:00:00
1   1 days, 00:00:00
2   2 days, 00:00:00
dtype: timedelta64[ns]

In [6]: td / np.timedelta64(1,'s')
Out[6]: 
0         0
1     86400
2    172800
dtype: float64

This is new (used to raise)

In [7]: td.astype('timedelta64[s]')
Out[7]: 
0         0
1     86400
2    172800
dtype: float64

jreback added a commit that referenced this pull request Oct 24, 2013
ENH: allow astype conversions for timedeltas to other timedelta freqs (still returns a float series), related to GH4521
@jreback jreback merged commit ee0c92c into pandas-dev:master Oct 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant