Skip to content

fillna() on Series or DataFrame containing datetime64 mess the values #6587

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

Closed
yonil7 opened this issue Mar 10, 2014 · 2 comments · Fixed by #6588
Closed

fillna() on Series or DataFrame containing datetime64 mess the values #6587

yonil7 opened this issue Mar 10, 2014 · 2 comments · Fixed by #6588
Labels
Bug Datetime Datetime data dtype Dtype Conversions Unexpected or buggy dtype conversions Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Milestone

Comments

@yonil7
Copy link

yonil7 commented Mar 10, 2014

s = pd.Series([pd.NaT, pd.NaT, '2013-08-05 15:30:00.000001'])
print s
0 NaT
1 NaT
2 2013-08-05 15:30:00.000001
dtype: datetime64[ns]

print s.fillna(method='backfill')
0 2013-08-05 15:30:00.000001024
1 2013-08-05 15:30:00.000001024
2 2013-08-05 15:30:00.000001024
dtype: datetime64[ns]

This happens with pandas 0.13.1 and numpy 1.8.0

@jreback
Copy link
Contributor

jreback commented Mar 10, 2014

hmm...looks like a rounding/precision issue.

care to have a look into this?

@jreback jreback added this to the 0.14.0 milestone Mar 10, 2014
@jreback
Copy link
Contributor

jreback commented Mar 10, 2014

its sending this to the method with the dtype stripped, so it ends up converting to float and back (rather than using the correct datetime routines)....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Dtype Conversions Unexpected or buggy dtype conversions Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants