diff --git a/pandas-stubs/core/frame.pyi b/pandas-stubs/core/frame.pyi index 0e151c4a6..3102e02fc 100644 --- a/pandas-stubs/core/frame.pyi +++ b/pandas-stubs/core/frame.pyi @@ -1874,7 +1874,7 @@ class DataFrame(NDFrame, OpsMixin): def pct_change( self, periods: int = ..., - fill_method: _str = ..., + fill_method: None = ..., limit: int | None = ..., freq=..., **kwargs, diff --git a/tests/test_frame.py b/tests/test_frame.py index 33aa1616e..2ff0348c2 100644 --- a/tests/test_frame.py +++ b/tests/test_frame.py @@ -2108,6 +2108,11 @@ def test_groupby_series_methods() -> None: gb.nth(0).loc[1] +def test_dataframe_pct_change() -> None: + df = pd.DataFrame({"x": [1, 2, 2, 3, 3], "y": [10, 20, 30, 40, 50]}) + df.pct_change(fill_method=None) + + def test_indexslice_setitem(): df = pd.DataFrame( {"x": [1, 2, 2, 3], "y": [1, 2, 3, 4], "z": [10, 20, 30, 40]}