Skip to content

Commit

Permalink
GH992 Fix pd.DataFrame.pct_change fill_method typing (#993)
Browse files Browse the repository at this point in the history
* Adding new optional workflow

* Update new workflow

* Update new workflow

* GH992 Fix pd.DataFrame.pct_change fill_method typing

* Update pandas-stubs/core/frame.pyi

Co-authored-by: Irv Lustig <irv@princeton.com>

* PR Feedback

---------

Co-authored-by: Irv Lustig <irv@princeton.com>
  • Loading branch information
loicdiridollou and Dr-Irv authored Sep 5, 2024
1 parent 532fc66 commit 96be866
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]}
Expand Down

0 comments on commit 96be866

Please sign in to comment.