@@ -9351,7 +9351,6 @@ def between_time(
93519351 def resample (
93529352 self ,
93539353 rule ,
9354- axis : Axis | lib .NoDefault = lib .no_default ,
93559354 closed : Literal ["right" , "left" ] | None = None ,
93569355 label : Literal ["right" , "left" ] | None = None ,
93579356 convention : Literal ["start" , "end" , "s" , "e" ] | lib .NoDefault = lib .no_default ,
@@ -9374,13 +9373,6 @@ def resample(
93749373 ----------
93759374 rule : DateOffset, Timedelta or str
93769375 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.
93849376 closed : {{'right', 'left'}}, default None
93859377 Which side of bin interval is closed. The default is 'left'
93869378 for all frequency offsets except for 'ME', 'YE', 'QE', 'BME',
@@ -9692,25 +9684,6 @@ def resample(
96929684 """
96939685 from pandas .core .resample import get_resampler
96949686
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-
97149687 if kind is not lib .no_default :
97159688 # GH#55895
97169689 warnings .warn (
@@ -9740,7 +9713,6 @@ def resample(
97409713 freq = rule ,
97419714 label = label ,
97429715 closed = closed ,
9743- axis = axis ,
97449716 kind = kind ,
97459717 convention = convention ,
97469718 key = on ,
@@ -12511,33 +12483,10 @@ def rolling(
1251112483 center : bool_t = False ,
1251212484 win_type : str | None = None ,
1251312485 on : str | None = None ,
12514- axis : Axis | lib .NoDefault = lib .no_default ,
1251512486 closed : IntervalClosedType | None = None ,
1251612487 step : int | None = None ,
1251712488 method : str = "single" ,
1251812489 ) -> 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-
1254112490 if win_type is not None :
1254212491 return Window (
1254312492 self ,
@@ -12546,7 +12495,6 @@ def rolling(
1254612495 center = center ,
1254712496 win_type = win_type ,
1254812497 on = on ,
12549- axis = axis ,
1255012498 closed = closed ,
1255112499 step = step ,
1255212500 method = method ,
@@ -12559,7 +12507,6 @@ def rolling(
1255912507 center = center ,
1256012508 win_type = win_type ,
1256112509 on = on ,
12562- axis = axis ,
1256312510 closed = closed ,
1256412511 step = step ,
1256512512 method = method ,
@@ -12570,31 +12517,9 @@ def rolling(
1257012517 def expanding (
1257112518 self ,
1257212519 min_periods : int = 1 ,
12573- axis : Axis | lib .NoDefault = lib .no_default ,
1257412520 method : Literal ["single" , "table" ] = "single" ,
1257512521 ) -> 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 )
1259812523
1259912524 @final
1260012525 @doc (ExponentialMovingWindow )
@@ -12607,32 +12532,9 @@ def ewm(
1260712532 min_periods : int | None = 0 ,
1260812533 adjust : bool_t = True ,
1260912534 ignore_na : bool_t = False ,
12610- axis : Axis | lib .NoDefault = lib .no_default ,
1261112535 times : np .ndarray | DataFrame | Series | None = None ,
1261212536 method : Literal ["single" , "table" ] = "single" ,
1261312537 ) -> 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-
1263612538 return ExponentialMovingWindow (
1263712539 self ,
1263812540 com = com ,
@@ -12642,7 +12544,6 @@ def ewm(
1264212544 min_periods = min_periods ,
1264312545 adjust = adjust ,
1264412546 ignore_na = ignore_na ,
12645- axis = axis ,
1264612547 times = times ,
1264712548 method = method ,
1264812549 )
0 commit comments