Skip to content

Series with dtype='M8[us]' does not create NaT values #2800

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
adamsd5 opened this issue Feb 5, 2013 · 3 comments
Closed

Series with dtype='M8[us]' does not create NaT values #2800

adamsd5 opened this issue Feb 5, 2013 · 3 comments
Assignees
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions
Milestone

Comments

@adamsd5
Copy link

adamsd5 commented Feb 5, 2013

Using Pandas 0.10.1, python 2.7, and Numpy 1.6.2:

>>> npa = numpy.ndarray(1, dtype=numpy.int64)
>>> npa[0] = -9223372036854775808
>>> type(pandas.Series(npa, dtype='M8[ns]')[0])
<class 'pandas.tslib.NaTType'>
>>> type(pandas.Series(npa, dtype='M8[us]')[0])
<class 'pandas.tslib.Timestamp'>

The latter should also have class 'pandas.tslib.NaTType', right?

@wesm
Copy link
Member

wesm commented Feb 6, 2013

Units other than nanoseconds are not supported right now in indexing etc. This should be strictly enforced

@adamsd5
Copy link
Author

adamsd5 commented Feb 6, 2013

Agreed. An exception or an automatic up-conversion to nanoseconds seems reasonable.

@ghost ghost assigned jreback Mar 11, 2013
@jreback
Copy link
Contributor

jreback commented Sep 13, 2013

this was closed by #3516 in 0.12

In [6]: pandas.Series(npa, dtype='M8[us]')
TypeError: cannot convert datetimelike to dtype [datetime64[us]]

@jreback jreback closed this as completed Sep 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

No branches or pull requests

3 participants