@@ -9351,7 +9351,6 @@ def between_time(
9351
9351
def resample (
9352
9352
self ,
9353
9353
rule ,
9354
- axis : Axis | lib .NoDefault = lib .no_default ,
9355
9354
closed : Literal ["right" , "left" ] | None = None ,
9356
9355
label : Literal ["right" , "left" ] | None = None ,
9357
9356
convention : Literal ["start" , "end" , "s" , "e" ] | lib .NoDefault = lib .no_default ,
@@ -9374,13 +9373,6 @@ def resample(
9374
9373
----------
9375
9374
rule : DateOffset, Timedelta or str
9376
9375
The offset string or object representing target conversion.
9377
- axis : {{0 or 'index', 1 or 'columns'}}, default 0
9378
- Which axis to use for up- or down-sampling. For `Series` this parameter
9379
- is unused and defaults to 0. Must be
9380
- `DatetimeIndex`, `TimedeltaIndex` or `PeriodIndex`.
9381
-
9382
- .. deprecated:: 2.0.0
9383
- Use frame.T.resample(...) instead.
9384
9376
closed : {{'right', 'left'}}, default None
9385
9377
Which side of bin interval is closed. The default is 'left'
9386
9378
for all frequency offsets except for 'ME', 'YE', 'QE', 'BME',
@@ -9692,25 +9684,6 @@ def resample(
9692
9684
"""
9693
9685
from pandas .core .resample import get_resampler
9694
9686
9695
- if axis is not lib .no_default :
9696
- axis = self ._get_axis_number (axis )
9697
- if axis == 1 :
9698
- warnings .warn (
9699
- "DataFrame.resample with axis=1 is deprecated. Do "
9700
- "`frame.T.resample(...)` without axis instead." ,
9701
- FutureWarning ,
9702
- stacklevel = find_stack_level (),
9703
- )
9704
- else :
9705
- warnings .warn (
9706
- f"The 'axis' keyword in { type (self ).__name__ } .resample is "
9707
- "deprecated and will be removed in a future version." ,
9708
- FutureWarning ,
9709
- stacklevel = find_stack_level (),
9710
- )
9711
- else :
9712
- axis = 0
9713
-
9714
9687
if kind is not lib .no_default :
9715
9688
# GH#55895
9716
9689
warnings .warn (
@@ -9740,7 +9713,6 @@ def resample(
9740
9713
freq = rule ,
9741
9714
label = label ,
9742
9715
closed = closed ,
9743
- axis = axis ,
9744
9716
kind = kind ,
9745
9717
convention = convention ,
9746
9718
key = on ,
@@ -12511,33 +12483,10 @@ def rolling(
12511
12483
center : bool_t = False ,
12512
12484
win_type : str | None = None ,
12513
12485
on : str | None = None ,
12514
- axis : Axis | lib .NoDefault = lib .no_default ,
12515
12486
closed : IntervalClosedType | None = None ,
12516
12487
step : int | None = None ,
12517
12488
method : str = "single" ,
12518
12489
) -> Window | Rolling :
12519
- if axis is not lib .no_default :
12520
- axis = self ._get_axis_number (axis )
12521
- name = "rolling"
12522
- if axis == 1 :
12523
- warnings .warn (
12524
- f"Support for axis=1 in { type (self ).__name__ } .{ name } is "
12525
- "deprecated and will be removed in a future version. "
12526
- f"Use obj.T.{ name } (...) instead" ,
12527
- FutureWarning ,
12528
- stacklevel = find_stack_level (),
12529
- )
12530
- else :
12531
- warnings .warn (
12532
- f"The 'axis' keyword in { type (self ).__name__ } .{ name } is "
12533
- "deprecated and will be removed in a future version. "
12534
- "Call the method without the axis keyword instead." ,
12535
- FutureWarning ,
12536
- stacklevel = find_stack_level (),
12537
- )
12538
- else :
12539
- axis = 0
12540
-
12541
12490
if win_type is not None :
12542
12491
return Window (
12543
12492
self ,
@@ -12546,7 +12495,6 @@ def rolling(
12546
12495
center = center ,
12547
12496
win_type = win_type ,
12548
12497
on = on ,
12549
- axis = axis ,
12550
12498
closed = closed ,
12551
12499
step = step ,
12552
12500
method = method ,
@@ -12559,7 +12507,6 @@ def rolling(
12559
12507
center = center ,
12560
12508
win_type = win_type ,
12561
12509
on = on ,
12562
- axis = axis ,
12563
12510
closed = closed ,
12564
12511
step = step ,
12565
12512
method = method ,
@@ -12570,31 +12517,9 @@ def rolling(
12570
12517
def expanding (
12571
12518
self ,
12572
12519
min_periods : int = 1 ,
12573
- axis : Axis | lib .NoDefault = lib .no_default ,
12574
12520
method : Literal ["single" , "table" ] = "single" ,
12575
12521
) -> Expanding :
12576
- if axis is not lib .no_default :
12577
- axis = self ._get_axis_number (axis )
12578
- name = "expanding"
12579
- if axis == 1 :
12580
- warnings .warn (
12581
- f"Support for axis=1 in { type (self ).__name__ } .{ name } is "
12582
- "deprecated and will be removed in a future version. "
12583
- f"Use obj.T.{ name } (...) instead" ,
12584
- FutureWarning ,
12585
- stacklevel = find_stack_level (),
12586
- )
12587
- else :
12588
- warnings .warn (
12589
- f"The 'axis' keyword in { type (self ).__name__ } .{ name } is "
12590
- "deprecated and will be removed in a future version. "
12591
- "Call the method without the axis keyword instead." ,
12592
- FutureWarning ,
12593
- stacklevel = find_stack_level (),
12594
- )
12595
- else :
12596
- axis = 0
12597
- return Expanding (self , min_periods = min_periods , axis = axis , method = method )
12522
+ return Expanding (self , min_periods = min_periods , method = method )
12598
12523
12599
12524
@final
12600
12525
@doc (ExponentialMovingWindow )
@@ -12607,32 +12532,9 @@ def ewm(
12607
12532
min_periods : int | None = 0 ,
12608
12533
adjust : bool_t = True ,
12609
12534
ignore_na : bool_t = False ,
12610
- axis : Axis | lib .NoDefault = lib .no_default ,
12611
12535
times : np .ndarray | DataFrame | Series | None = None ,
12612
12536
method : Literal ["single" , "table" ] = "single" ,
12613
12537
) -> ExponentialMovingWindow :
12614
- if axis is not lib .no_default :
12615
- axis = self ._get_axis_number (axis )
12616
- name = "ewm"
12617
- if axis == 1 :
12618
- warnings .warn (
12619
- f"Support for axis=1 in { type (self ).__name__ } .{ name } is "
12620
- "deprecated and will be removed in a future version. "
12621
- f"Use obj.T.{ name } (...) instead" ,
12622
- FutureWarning ,
12623
- stacklevel = find_stack_level (),
12624
- )
12625
- else :
12626
- warnings .warn (
12627
- f"The 'axis' keyword in { type (self ).__name__ } .{ name } is "
12628
- "deprecated and will be removed in a future version. "
12629
- "Call the method without the axis keyword instead." ,
12630
- FutureWarning ,
12631
- stacklevel = find_stack_level (),
12632
- )
12633
- else :
12634
- axis = 0
12635
-
12636
12538
return ExponentialMovingWindow (
12637
12539
self ,
12638
12540
com = com ,
@@ -12642,7 +12544,6 @@ def ewm(
12642
12544
min_periods = min_periods ,
12643
12545
adjust = adjust ,
12644
12546
ignore_na = ignore_na ,
12645
- axis = axis ,
12646
12547
times = times ,
12647
12548
method = method ,
12648
12549
)
0 commit comments