Skip to content

time delta index #7425

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
hayd opened this issue Jun 11, 2014 · 5 comments
Closed

time delta index #7425

hayd opened this issue Jun 11, 2014 · 5 comments
Labels
Enhancement Timedelta Timedelta data type
Milestone

Comments

@hayd
Copy link
Contributor

hayd commented Jun 11, 2014

You can't seem to create a time delta index, even if you force object dtype:

In [4]: td = pd.Series([np.timedelta64(10000), pd.NaT], dtype='timedelta64[ns]')

In [5]: pd.Index(td)
Out[5]: Int64Index([10000, -9223372036854775808], dtype='int64')

In [6]: pd.Index(td, dtype= 'timedelta64[ns]')
Out[6]: Int64Index([10000, -9223372036854775808], dtype='int64')

related to #7423

Perhaps there is already an issue for this?

@cpcloud
Copy link
Member

cpcloud commented Jun 11, 2014

There's an issue for implementing time delta indexes but not for making object indexes with them. Can you create one with Python timedeltas?

@jreback
Copy link
Contributor

jreback commented Jun 11, 2014

a time delta index impl is not that hard
it's very much like DatetimeIndex

@hayd hayd added this to the 0.15.0 milestone Jun 11, 2014
@cpcloud
Copy link
Member

cpcloud commented Jun 11, 2014

Yep I just need to carve out some time for it among the other million issues :) I think split and replace Apis are higher priority

@shoyer
Copy link
Member

shoyer commented Jun 11, 2014

Here is the existing issue for TimedeltaIndex: #3009

You actually can make an object index with a list of np.timedelta64 objects, but not from an ndarray:

>>> pd.Index(list(td))
Index([10000 nanoseconds, NaT], dtype='object')

@hayd
Copy link
Contributor Author

hayd commented Jun 11, 2014

thanks, closing as dupe

@hayd hayd closed this as completed Jun 11, 2014
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

No branches or pull requests

4 participants