Skip to content

Commit d7be7c3

Browse files
authored
clean: Groupby deprecations (#1143)
clean: address several groupby deprecations
1 parent 71eaa0d commit d7be7c3

File tree

1 file changed

+3
-34
lines changed

1 file changed

+3
-34
lines changed

pandas-stubs/core/groupby/generic.pyi

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ from collections.abc import (
33
Hashable,
44
Iterable,
55
Iterator,
6-
Mapping,
76
Sequence,
87
)
98
from typing import (
@@ -29,14 +28,11 @@ from typing_extensions import (
2928
TypeAlias,
3029
)
3130

32-
from pandas._libs.lib import NoDefault
3331
from pandas._libs.tslibs.timestamps import Timestamp
3432
from pandas._typing import (
3533
S1,
3634
AggFuncTypeBase,
3735
AggFuncTypeFrame,
38-
ArrayLike,
39-
Axis,
4036
ByT,
4137
CorrelationMethod,
4238
Dtype,
@@ -113,26 +109,13 @@ class SeriesGroupBy(GroupBy[Series[S1]], Generic[S1, ByT]):
113109
bins: int | Sequence[int] | None = ...,
114110
dropna: bool = ...,
115111
) -> Series[float]: ...
116-
def fillna(
117-
self,
118-
value: (
119-
Scalar | ArrayLike | Series | DataFrame | Mapping[Hashable, Scalar] | None
120-
) = ...,
121-
method: Literal["bfill", "ffill"] | None = ...,
122-
axis: Axis | None | NoDefault = ...,
123-
inplace: bool = ...,
124-
limit: int | None = ...,
125-
downcast: dict | None | NoDefault = ...,
126-
) -> Series[S1] | None: ...
127112
def take(
128113
self,
129114
indices: TakeIndexer,
130-
axis: Axis | NoDefault = ...,
131115
**kwargs,
132116
) -> Series[S1]: ...
133117
def skew(
134118
self,
135-
axis: Axis | NoDefault = ...,
136119
skipna: bool = ...,
137120
numeric_only: bool = ...,
138121
**kwargs,
@@ -145,8 +128,8 @@ class SeriesGroupBy(GroupBy[Series[S1]], Generic[S1, ByT]):
145128
def nsmallest(
146129
self, n: int = ..., keep: Literal["first", "last", "all"] = ...
147130
) -> Series[S1]: ...
148-
def idxmin(self, axis: Axis | NoDefault = ..., skipna: bool = ...) -> Series: ...
149-
def idxmax(self, axis: Axis | NoDefault = ..., skipna: bool = ...) -> Series: ...
131+
def idxmin(self, skipna: bool = ...) -> Series: ...
132+
def idxmax(self, skipna: bool = ...) -> Series: ...
150133
def corr(
151134
self,
152135
other: Series,
@@ -242,13 +225,11 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]):
242225
def nunique(self, dropna: bool = ...) -> DataFrame: ...
243226
def idxmax(
244227
self,
245-
axis: Axis | None | NoDefault = ...,
246228
skipna: bool = ...,
247229
numeric_only: bool = ...,
248230
) -> DataFrame: ...
249231
def idxmin(
250232
self,
251-
axis: Axis | None | NoDefault = ...,
252233
skipna: bool = ...,
253234
numeric_only: bool = ...,
254235
) -> DataFrame: ...
@@ -336,13 +317,10 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]):
336317
ascending: bool = ...,
337318
dropna: bool = ...,
338319
) -> DataFrame: ...
339-
def take(
340-
self, indices: TakeIndexer, axis: Axis | None | NoDefault = ..., **kwargs
341-
) -> DataFrame: ...
320+
def take(self, indices: TakeIndexer, **kwargs) -> DataFrame: ...
342321
@overload
343322
def skew(
344323
self,
345-
axis: Axis | None | NoDefault = ...,
346324
skipna: bool = ...,
347325
numeric_only: bool = ...,
348326
*,
@@ -352,7 +330,6 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]):
352330
@overload
353331
def skew(
354332
self,
355-
axis: Axis | None | NoDefault = ...,
356333
skipna: bool = ...,
357334
numeric_only: bool = ...,
358335
*,
@@ -394,14 +371,6 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]):
394371
) -> Series: ... # Series[Axes] but this is not allowed
395372
@property
396373
def dtypes(self) -> Series: ...
397-
def corrwith(
398-
self,
399-
other: DataFrame | Series,
400-
axis: Axis | NoDefault = ...,
401-
drop: bool = ...,
402-
method: CorrelationMethod = ...,
403-
numeric_only: bool = ...,
404-
) -> DataFrame: ...
405374
def __getattr__(self, name: str) -> SeriesGroupBy[Any, ByT]: ...
406375
# Overrides that provide more precise return types over the GroupBy class
407376
@final # type: ignore[misc]

0 commit comments

Comments
 (0)