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: setting a slice with datetime64 ignores datetime64 resolution #10412

Closed
jorisvandenbossche opened this issue Jun 23, 2015 · 1 comment · Fixed by #10644
Closed

BUG: setting a slice with datetime64 ignores datetime64 resolution #10412

jorisvandenbossche opened this issue Jun 23, 2015 · 1 comment · Fixed by #10644
Labels
Bug Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@jorisvandenbossche
Copy link
Member

Resulting in 1970 datetimes when using eg datetime64[D] resolution (splitted from #10408):

In [46]: df=pd.DataFrame({'c':pd.Timestamp('2010-10-01')}, index=range(5))

In [47]: df
Out[47]:
           c
0 2010-10-01
1 2010-10-01
2 2010-10-01
3 2010-10-01
4 2010-10-01

In [48]: df.loc[0:2,'c'] = np.datetime64('2010-10-12')

In [49]: df
Out[49]:
                              c
0 1970-01-01 00:00:00.000014894
1 1970-01-01 00:00:00.000014894
2 1970-01-01 00:00:00.000014894
3 2010-10-01 00:00:00.000000000
4 2010-10-01 00:00:00.000000000
@schettino72
Copy link
Contributor

PR #10644

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants