Skip to content

Conversation

shoyer
Copy link
Member

@shoyer shoyer commented Jun 15, 2014

It turns out that the ndarray-like arrays of dtype datetime64 were
not being properly cast to an Index, because -- due to a bug with
np.datetime64 -- calling np.asarray(x, dtype=object) if x is an
ndarray of type datetime64 results in an integer array.

This PR adds tests and a work around to pd.Index.__new__.

Related #5460

It turns out that the ndarray-like arrays of dtype datetime64 were
not being properly cast to an Index, because -- due to a bug with
np.datetime64 -- calling np.asarray(x, dtype=object) if x is an
ndarray of type datetime64 results in an *integer* array.

This PR adds tests and a work around to pd.Index.__new__.

Related pandas-dev#5460
@jreback jreback added this to the 0.14.1 milestone Jun 16, 2014
jreback added a commit that referenced this pull request Jun 16, 2014
ENH: Cast ndarray-like datetime64 arrays to Index properly
@jreback jreback merged commit 38ca1e0 into pandas-dev:master Jun 16, 2014
@jreback
Copy link
Contributor

jreback commented Jun 16, 2014

thanks

seem inocuous enough....famous last words though :)

@shoyer shoyer deleted the ndarray-like-to-index branch June 16, 2014 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Design Indexing Related to indexing on series/frames, not to indexes themselves

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants