Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ class DataFrame(NDFrame, OpsMixin):
dropna: _bool = ...,
margins_name: _str = ...,
observed: _bool = ...,
sort: _bool = ...,
) -> DataFrame: ...
@overload
def stack(
Expand Down
12 changes: 12 additions & 0 deletions tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,18 @@ def test_types_pivot_table() -> None:
pd.DataFrame,
)

def test_pivot_table_sort():
df = pd.DataFrame(
{"a": [1, 2],
"b": [3, 4],
"c": [5, 6],
"d": [7, 8]}
)


check(assert_type(df.pivot_table(values="a", index="b", columns="c"
, sort=True), pd.DataFrame), pd.DataFrame)


def test_types_groupby_as_index() -> None:
"""Test type of groupby.size method depending on `as_index`."""
Expand Down
Loading