Skip to content

GH1169 Improve parameter types for DataFrame.pct_change and Series.pct_change #1194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 24, 2025
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
8 changes: 5 additions & 3 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1987,11 +1987,13 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def ne(self, other, axis: Axis = ..., level: Level | None = ...) -> Self: ...
def pct_change(
self,
periods: int = ...,
periods: int = 1,
fill_method: None = ...,
limit: int | None = ...,
freq=...,
**kwargs: Any, # TODO: make more precise https://github.com/pandas-dev/pandas-stubs/issues/1169
freq: Frequency | dt.timedelta | None = None,
*,
axis: AxisIndex = ...,
fill_value: object | None = ...,
) -> Self: ...
def pop(self, item: _str) -> Series: ...
def pow(
Expand Down
10 changes: 6 additions & 4 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1548,11 +1548,13 @@ class Series(IndexOpsMixin[S1], NDFrame):
) -> Series[S1]: ...
def pct_change(
self,
periods: int = ...,
fill_method: _str = ...,
periods: int = 1,
fill_method: None = ...,
limit: int | None = ...,
freq=...,
**kwargs: Any, # TODO: make more precise https://github.com/pandas-dev/pandas-stubs/issues/1169
freq: Frequency | timedelta | None = None,
*,
axis: AxisIndex = ...,
fill_value: object | None = ...,
) -> Series[S1]: ...
def first_valid_index(self) -> Scalar: ...
def last_valid_index(self) -> Scalar: ...
Expand Down