Skip to content

Commit 24523e5

Browse files
committed
Reverts
1 parent b71e699 commit 24523e5

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

pandas/core/missing.py

+10-13
Original file line numberDiff line numberDiff line change
@@ -314,19 +314,16 @@ def get_interp_index(method, index: Index) -> Index:
314314
# prior default
315315
from pandas import Index
316316

317-
index = Index(range(len(index)))
318-
319-
# if isinstance(index.dtype, DatetimeTZDtype) or lib.is_np_dtype(
320-
# index.dtype, "mM"
321-
# ):
322-
# # Convert datetime-like indexes to int64
323-
# index = Index(index.view("i8"))
324-
#
325-
# elif not is_numeric_dtype(index.dtype):
326-
# # We keep behavior consistent with prior versions of pandas for
327-
# # non-numeric, non-datetime indexes
328-
# index = Index(range(len(index)))
329-
317+
if isinstance(index.dtype, DatetimeTZDtype) or lib.is_np_dtype(
318+
index.dtype, "mM"
319+
):
320+
# Convert datetime-like indexes to int64
321+
index = Index(index.view("i8"))
322+
323+
elif not is_numeric_dtype(index.dtype):
324+
# We keep behavior consistent with prior versions of pandas for
325+
# non-numeric, non-datetime indexes
326+
index = Index(range(len(index)))
330327
else:
331328
methods = {"index", "values", "nearest", "time"}
332329
is_numeric_or_datetime = (

pandas/tests/resample/test_time_grouper.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -412,15 +412,8 @@ def test_groupby_resample_interpolate_with_apply_syntax_off_grid(groupy_test_df)
412412
with resampling that results in missing anchor points when interpolating.
413413
See GH#21351."""
414414
# GH#21351
415-
print(groupy_test_df)
416-
417-
def foo(x):
418-
print(x)
419-
return x.resample("265h").interpolate(method="linear")
420-
421415
result = groupy_test_df.groupby("volume").apply(
422-
# lambda x: x.resample("265h").interpolate(method="linear")
423-
foo
416+
lambda x: x.resample("265h").interpolate(method="linear")
424417
)
425418

426419
volume = [50, 50, 60]

0 commit comments

Comments
 (0)