Skip to content

Commit df86708

Browse files
committed
fix: Make sure frequency indexes are preserved with new interpolation approach
1 parent 992e207 commit df86708

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/resample.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,11 @@ def interpolate(
11171117
# resampled index are removed
11181118
if is_period_index:
11191119
return result_interpolated
1120-
return result_interpolated.loc[final_index]
1120+
1121+
result_interpolated = result_interpolated.loc[final_index]
1122+
# This is to make sure that frequency indexes are preserved
1123+
result_interpolated.index = final_index
1124+
return result_interpolated
11211125

11221126
@final
11231127
def asfreq(self, fill_value=None):

0 commit comments

Comments
 (0)