Skip to content

Commit ec08504

Browse files
committed
perf
1 parent c63708f commit ec08504

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

pandas/core/missing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ def get_interp_index(method, index: Index) -> Index:
312312
# create/use the index
313313
if method == "linear":
314314
# prior default
315-
from pandas import Index
315+
from pandas import RangeIndex
316316

317-
index = Index(np.arange(len(index)))
317+
index = RangeIndex(len(index))
318318
else:
319319
methods = {"index", "values", "nearest", "time"}
320320
is_numeric_or_datetime = (

pandas/tests/resample/test_base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ def test_resample_interpolate_regular_sampling_off_grid(
126126
result = ser.resample("1h").interpolate(method)
127127

128128
if method == "linear":
129-
values = np.repeat(np.arange(0.0, 4.0), 2) + np.tile(
130-
np.arange(1 / 3, 0.7, 1 / 3), 4
131-
)
129+
values = np.repeat(np.arange(0.0, 4.0), 2) + np.tile([1 / 3, 2 / 3], 4)
132130
elif method == "nearest":
133131
values = np.repeat(np.arange(0.0, 5.0), 2)[1:-1]
134132
elif method == "zero":

0 commit comments

Comments
 (0)