Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
pd.Series.interpolate() ValueError for some methods with TZ localized index #27548
Code Sample, a copy-pastable example if possible
import pandas as pd ser = pd.Series([1.0, pd.np.nan, 2.0], index=pd.date_range( start='20190101T0000', freq='1h', periods=3)) print(ser.interpolate(method='pad')) print(ser.tz_localize('UTC').interpolate(method='pad')) # raises ValueError
Interpolation of a Series with a TZ localized DatetimeIndex raises a ValueError when method is not one of (linear, index, values, nearest, time). This does not occur with version 0.24.2, and I think the bug was introduced in #25394.
2019-01-01 00:00:00 1.0