BUG: setting a slice with datetime64 ignores datetime64 resolution · Issue #10412 · pandas-dev/pandas (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
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