Skip to content
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

BUG/CLN: datetime64/timedelta64 #3516

Merged
merged 3 commits into from
May 8, 2013
Merged

BUG/CLN: datetime64/timedelta64 #3516

merged 3 commits into from
May 8, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented May 2, 2013

Various bugs related to datetime64s

This would convert to object dtype previously

In [1]: dates = [
   ...:     np.datetime64(datetime.date(2013, 1, 1)),
   ...:     np.datetime64(datetime.date(2013, 1, 2)),
   ...:     np.datetime64(datetime.date(2013, 1, 3)),
   ...: ]

In [2]: s = pd.Series(dates)

In [3]: s
Out[3]: 
0   2013-01-01 00:00:00
1   2013-01-02 00:00:00
2   2013-01-03 00:00:00
dtype: datetime64[ns]

Any creation/astype of a datetimelike to a non accepted dtype will raise

In [6]: Series([Timestamp('20130101'),Timestamp('20130102')],dtype='datetime64[s]')
TypeError: cannot convert datetimelike to dtype [datetime64[s]]

@jreback
Copy link
Contributor Author

jreback commented May 2, 2013

@wesm @y-p These are various datetime fixes, really minor. They basically disallow datetime operations that can cause weird issues, e.g. trying to convert a datetime64[ns] to something which we don't support now will raise

jreback added 3 commits May 8, 2013 16:29
     fixes GH2423, astyping is now checked when using datetimelike and timedeltalike
     for valid astype to dtypes

BUG: PY3 compat for timedelta64[ns] in astype

BUG: more py3 compat

PTF
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