Skip to content

Commit 9ba666c

Browse files
committed
value_counts, crosstab
1 parent d21f1d6 commit 9ba666c

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

pandas-stubs/__init__.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ from pandas.core.arrays.sparse import SparseDtype as SparseDtype
6969
from pandas.core.computation.api import eval as eval
7070
from pandas.core.reshape.api import (
7171
concat as concat,
72+
crosstab as crosstab,
7273
from_dummies as from_dummies,
7374
get_dummies as get_dummies,
7475
lreshape as lreshape,
@@ -80,9 +81,6 @@ from pandas.core.reshape.api import (
8081
qcut as qcut,
8182
wide_to_long as wide_to_long,
8283
)
83-
from pandas.core.reshape.api import (
84-
crosstab as crosstab, # pyright: ignore[reportUnknownVariableType]
85-
)
8684
from pandas.core.reshape.api import (
8785
cut as cut, # pyright: ignore[reportUnknownVariableType]
8886
)

pandas-stubs/core/reshape/pivot.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ def pivot(
123123
columns: _NonIterableHashable | Sequence[HashableT2] = ...,
124124
values: _NonIterableHashable | Sequence[HashableT3] = ...,
125125
) -> DataFrame: ...
126+
127+
_Values: TypeAlias = SequenceNotStr[Any] | _ExtendedAnyArrayLike
128+
126129
@overload
127130
def crosstab(
128131
index: _Values | list[_Values],

tests/extension/decimal/array.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,12 @@ def convert_values(param: Any) -> ExtensionArray | list[Any]:
345345

346346
def value_counts(self, dropna: bool = True) -> Series:
347347
from pandas.core.algorithms import ( # type: ignore[attr-defined] # isort: skip
348-
value_counts, # pyright: ignore[reportAttributeAccessIssue]
348+
value_counts, # pyright: ignore[reportAttributeAccessIssue,reportAttributeAccessIssue]
349349
)
350350

351-
return value_counts(self.to_numpy(), dropna=dropna)
351+
return value_counts(
352+
self.to_numpy(), dropna=dropna
353+
) # pyright: ignore[reportUnknownVariableType]
352354

353355

354356
DecimalArray._add_arithmetic_ops()

0 commit comments

Comments
 (0)