Skip to content

Commit f6a00e9

Browse files
committed
add 'mean' default, correct 'All' default, specify
1 parent f997017 commit f6a00e9

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

pandas-stubs/core/reshape/pivot.pyi

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ from collections.abc import (
66
)
77
import datetime
88
from typing import (
9+
Any,
910
Literal,
1011
TypeAlias,
1112
overload,
@@ -69,11 +70,11 @@ def pivot_table(
6970
columns: _PivotTableColumnsTypes = None,
7071
aggfunc: (
7172
_PivotAggFunc | Sequence[_PivotAggFunc] | Mapping[Hashable, _PivotAggFunc]
72-
) = ...,
73+
) = "mean",
7374
fill_value: Scalar | None = None,
7475
margins: bool = False,
7576
dropna: bool = True,
76-
margins_name: Hashable = "all",
77+
margins_name: Hashable = "All",
7778
observed: bool = True,
7879
sort: bool = True,
7980
) -> DataFrame: ...
@@ -85,22 +86,22 @@ def pivot_table(
8586
values: _PivotTableValuesTypes = None,
8687
*,
8788
index: Grouper,
88-
columns: _PivotTableColumnsTypes | Index | npt.NDArray = None,
89+
columns: _PivotTableColumnsTypes | npt.NDArray[Any] | Index = None,
8990
aggfunc: (
9091
_PivotAggFunc | Sequence[_PivotAggFunc] | Mapping[Hashable, _PivotAggFunc]
9192
) = "mean",
9293
fill_value: Scalar | None = None,
9394
margins: bool = False,
9495
dropna: bool = True,
95-
margins_name: Hashable = "all",
96+
margins_name: Hashable = "All",
9697
observed: bool = True,
9798
sort: bool = True,
9899
) -> DataFrame: ...
99100
@overload
100101
def pivot_table(
101102
data: DataFrame,
102103
values: _PivotTableValuesTypes = None,
103-
index: _PivotTableIndexTypes | Index | npt.NDArray = None,
104+
index: _PivotTableIndexTypes | npt.NDArray[Any] | Index = None,
104105
*,
105106
columns: Grouper,
106107
aggfunc: (
@@ -109,7 +110,7 @@ def pivot_table(
109110
fill_value: Scalar | None = None,
110111
margins: bool = False,
111112
dropna: bool = True,
112-
margins_name: Hashable = "all",
113+
margins_name: Hashable = "All",
113114
observed: bool = True,
114115
sort: bool = True,
115116
) -> DataFrame: ...

tests/test_plotting.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,7 @@ def test_boxplot(close_figures: None) -> None:
316316
Series,
317317
)
318318
check(
319-
assert_type(
320-
df.boxplot(column=["Col1"], return_type="both", by="Col4"),
321-
Series,
322-
),
319+
assert_type(df.boxplot(column=["Col1"], return_type="both", by="Col4"), Series),
323320
Series,
324321
)
325322

0 commit comments

Comments
 (0)