Skip to content

Commit a61b439

Browse files
committed
https://github.com/pandas-dev/pandas-stubs/pull/1462#discussion_r2490934466
1 parent 1adbffc commit a61b439

File tree

3 files changed

+0
-146
lines changed

3 files changed

+0
-146
lines changed
Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,21 @@
1-
from collections.abc import (
2-
Hashable,
3-
Iterator,
4-
)
51
from typing import (
62
Any,
73
final,
84
overload,
95
)
106

11-
import numpy as np
12-
from pandas import (
13-
DataFrame,
14-
Index,
15-
Series,
16-
)
177
from pandas.core.resample import TimeGrouper
188
from typing_extensions import Self
199

2010
from pandas._libs.lib import _NoDefaultDoNotUse
2111
from pandas._typing import (
22-
ArrayLike,
2312
Axis,
2413
Frequency,
2514
Incomplete,
2615
KeysArgType,
2716
Level,
2817
ListLikeHashable,
29-
npt,
3018
)
31-
from pandas.util._decorators import cache_readonly
32-
33-
from pandas.io.formats.printing import PrettyDict
3419

3520
class Grouper:
3621
key: KeysArgType | None
@@ -53,27 +38,3 @@ class Grouper:
5338
def __new__(cls, *args: Any, freq: Frequency, **kwargs: Any) -> TimeGrouper: ...
5439
@final
5540
def __repr__(self) -> str: ... # noqa: PYI029 __repr__ here is final
56-
57-
@final
58-
class Grouping:
59-
level: Level | None
60-
obj: DataFrame | Series | None
61-
in_axis: bool
62-
grouping_vector: Incomplete
63-
def __iter__(self) -> Iterator[Hashable]: ...
64-
@cache_readonly
65-
def name(self) -> Hashable: ...
66-
@cache_readonly
67-
def ngroups(self) -> int: ...
68-
@cache_readonly
69-
def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]: ...
70-
@property
71-
def codes(self) -> npt.NDArray[np.signedinteger]: ...
72-
@cache_readonly
73-
def group_arraylike(self) -> ArrayLike: ...
74-
@cache_readonly
75-
def result_index(self) -> Index: ...
76-
@cache_readonly
77-
def group_index(self) -> Index: ...
78-
@cache_readonly
79-
def groups(self) -> PrettyDict[Hashable, Index]: ...

pandas-stubs/core/groupby/ops.pyi

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,17 @@
11
from collections.abc import (
2-
Callable,
3-
Hashable,
42
Iterator,
53
)
64
from typing import (
75
Generic,
8-
final,
96
)
107

118
import numpy as np
12-
from pandas import (
13-
Index,
14-
Series,
15-
)
16-
from pandas.core.groupby import grouper
179

1810
from pandas._typing import (
19-
ArrayLike,
2011
AxisInt,
21-
Incomplete,
2212
NDFrameT,
23-
Shape,
24-
T,
2513
npt,
2614
)
27-
from pandas.util._decorators import cache_readonly
28-
29-
class BaseGrouper:
30-
axis: Index
31-
dropna: bool
32-
@property
33-
def groupings(self) -> list[grouper.Grouping]: ...
34-
@property
35-
def shape(self) -> Shape: ...
36-
def __iter__(self) -> Iterator: ...
37-
@property
38-
def nkeys(self) -> int: ...
39-
def get_iterator(
40-
self, data: NDFrameT, axis: AxisInt = ...
41-
) -> Iterator[tuple[Hashable, NDFrameT]]: ...
42-
@cache_readonly
43-
def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]: ...
44-
@final
45-
def result_ilocs(self) -> npt.NDArray[np.intp]: ...
46-
@final
47-
@property
48-
def codes(self) -> list[npt.NDArray[np.signedinteger]]: ...
49-
@property
50-
def levels(self) -> list[Index]: ...
51-
@property
52-
def names(self) -> list: ...
53-
@final
54-
def size(self) -> Series: ...
55-
@cache_readonly
56-
def groups(self) -> dict[Hashable, Index]: ...
57-
@final
58-
@cache_readonly
59-
def is_monotonic(self) -> bool: ...
60-
@final
61-
@cache_readonly
62-
def has_dropped_na(self) -> bool: ...
63-
@cache_readonly
64-
def group_info(self) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp], int]: ...
65-
@cache_readonly
66-
def codes_info(self) -> npt.NDArray[np.intp]: ...
67-
@final
68-
@cache_readonly
69-
def ngroups(self) -> int: ...
70-
@property
71-
def reconstructed_codes(self) -> list[npt.NDArray[np.intp]]: ...
72-
@cache_readonly
73-
def result_index(self) -> Index: ...
74-
@final
75-
def get_group_levels(self) -> list[ArrayLike]: ...
76-
@final
77-
def agg_series(
78-
self,
79-
obj: Series,
80-
func: Callable[[Series], object],
81-
preserve_dtype: bool = ...,
82-
) -> ArrayLike: ...
83-
@final
84-
def apply_groupwise(
85-
self, f: Callable[[NDFrameT], T], data: NDFrameT, axis: AxisInt = ...
86-
) -> tuple[list[T], bool]: ...
87-
88-
class BinGrouper(BaseGrouper):
89-
bins: npt.NDArray[np.int64]
90-
binlabels: Index
91-
indexer: npt.NDArray[np.intp]
92-
@cache_readonly
93-
def indices(self) -> dict[Incomplete, list[int]]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
9415

9516
class DataSplitter(Generic[NDFrameT]):
9617
data: NDFrameT

pandas-stubs/core/series.pyi

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ from pandas._typing import (
154154
FloatFormatType,
155155
Frequency,
156156
GenericT,
157-
GenericT_co,
158157
GroupByObjectNonScalar,
159158
HashableT1,
160159
IgnoreRaise,
@@ -4618,30 +4617,3 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
46184617
) -> Self: ...
46194618
@final
46204619
def __bool__(self) -> NoReturn: ...
4621-
4622-
@type_check_only
4623-
class _SeriesSubclassBase(Series[S1], Generic[S1, GenericT_co]):
4624-
@overload # type: ignore[override]
4625-
def to_numpy( # pyrefly: ignore
4626-
self,
4627-
dtype: None = None,
4628-
copy: bool = False,
4629-
na_value: Scalar = ...,
4630-
**kwargs: Any,
4631-
) -> np_1darray[GenericT_co]: ...
4632-
@overload
4633-
def to_numpy(
4634-
self,
4635-
dtype: np.dtype[GenericT] | SupportsDType[GenericT] | type[GenericT],
4636-
copy: bool = False,
4637-
na_value: Scalar = ...,
4638-
**kwargs: Any,
4639-
) -> np_1darray[GenericT]: ...
4640-
@overload
4641-
def to_numpy( # pyright: ignore[reportIncompatibleMethodOverride]
4642-
self,
4643-
dtype: DTypeLike,
4644-
copy: bool = False,
4645-
na_value: Scalar = ...,
4646-
**kwargs: Any,
4647-
) -> np_1darray: ...

0 commit comments

Comments
 (0)