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 in Series.replace with timezone-aware datetime columns #11792

multiloc opened this issue Dec 7, 2015 · 2 comments


None yet
2 participants
Copy link

commented Dec 7, 2015

Seeing the following behavior in 0.17.1 with the patch from #11715 applied (would raise without the patch):

In [29]: ser = pd.Series([pd.NaT, pd.Timestamp('2015/01/01', tz='UTC')])

# works
In [30]: ser.replace(pd.NaT, pd.Timestamp.min)
0    1677-09-22 00:12:43.145225
1     2015-01-01 00:00:00+00:00
dtype: object

# doesn't work
In [31]: ser.replace([np.nan, pd.NaT], pd.Timestamp.min)
0                         NaT
1   2015-01-01 00:00:00+00:00
dtype: datetime64[ns, UTC]

# works without timezone-aware datetimes
In [32]: ser = pd.Series([pd.NaT, pd.Timestamp('2015/01/01')])
In [33]: ser.replace([np.nan, pd.NaT], pd.Timestamp.min)
0   1677-09-22 00:12:43.145225
1   2015-01-01 00:00:00.000000
dtype: datetime64[ns]

This comment has been minimized.

Copy link

commented Dec 9, 2015

yep, looks like a buggie! (thanks for the multiple reports BTW). interested in a pull-request to fix?

@jreback jreback added this to the Next Major Release milestone Dec 9, 2015


This comment has been minimized.

Copy link
Contributor Author

commented Dec 10, 2015

sure, I'll look into it over the weekend

@mroeschke mroeschke referenced this issue Jun 23, 2018


TST: Clean old timezone issues PT2 #21612

10 of 10 tasks complete

@jreback jreback modified the milestones: Next Major Release, 0.24.0 Jun 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.