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

Comments

Projects
None yet
3 participants
@xhochy
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

This comment has been minimized.

Member

jorisvandenbossche commented Jan 13, 2018

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

This comment has been minimized.

Contributor

jreback commented Jan 13, 2018

yes, PR shortly

@jreback jreback changed the title from Behaviour change with #19176 to BUG: astype of datetimelike to non-NS Jan 13, 2018

jreback added a commit to jreback/pandas that referenced this issue Jan 13, 2018

jreback added a commit to jreback/pandas that referenced this issue Jan 13, 2018

jreback added a commit that referenced this issue Jan 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment