File tree 2 files changed +11
-21
lines changed
2 files changed +11
-21
lines changed Original file line number Diff line number Diff line change @@ -314,19 +314,16 @@ def get_interp_index(method, index: Index) -> Index:
314
314
# prior default
315
315
from pandas import Index
316
316
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 )))
330
327
else :
331
328
methods = {"index" , "values" , "nearest" , "time" }
332
329
is_numeric_or_datetime = (
Original file line number Diff line number Diff line change @@ -412,15 +412,8 @@ def test_groupby_resample_interpolate_with_apply_syntax_off_grid(groupy_test_df)
412
412
with resampling that results in missing anchor points when interpolating.
413
413
See GH#21351."""
414
414
# GH#21351
415
- print (groupy_test_df )
416
-
417
- def foo (x ):
418
- print (x )
419
- return x .resample ("265h" ).interpolate (method = "linear" )
420
-
421
415
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" )
424
417
)
425
418
426
419
volume = [50 , 50 , 60 ]
You can’t perform that action at this time.
0 commit comments