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: astype of datetimelike to non-NS #19223

Closed
xhochy opened this issue Jan 13, 2018 · 2 comments · Fixed by #19224
Closed

BUG: astype of datetimelike to non-NS #19223

xhochy opened this issue Jan 13, 2018 · 2 comments · Fixed by #19224
Labels
Bug Datetime Datetime data dtype Timedelta Timedelta data type
Milestone

Comments

@xhochy
Copy link
Contributor

xhochy commented Jan 13, 2018

The current pandas master includes a behaviour change date conversion.

Before #19176

In [1]: import pandas as pd

In [2]: pd.DataFrame({'x': [3, 2, 1]}).astype('M8[us]')
Out[2]:
                           x
0 1970-01-01 00:00:00.000003
1 1970-01-01 00:00:00.000002
2 1970-01-01 00:00:00.000001

After #19176

In [1]: import pandas as pd

In [2]: pd.DataFrame({'x': [3, 2, 1]}).astype('M8[us]')
Out[2]:
                              x
0 1970-01-01 00:00:00.000000003
1 1970-01-01 00:00:00.000000002
2 1970-01-01 00:00:00.000000001
@jorisvandenbossche
Copy link
Member

Hmm, we apparently didn't have any tests that catched this.
Anyhow, this is a regression that we should fix. By using plainly pd.to_datetime for any datetime64 dtype, we ignore the resolution.

@jorisvandenbossche jorisvandenbossche added this to the 0.23.0 milestone Jan 13, 2018
@jreback
Copy link
Contributor

jreback commented Jan 13, 2018

yes, PR shortly

@jreback jreback added Datetime Datetime data dtype Timedelta Timedelta data type labels Jan 13, 2018
@jreback jreback changed the title Behaviour change with #19176 BUG: astype of datetimelike to non-NS Jan 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants