Skip to content

Conversation

@loicdiridollou
Copy link
Member

fill_method: None = None,
freq: Frequency | dt.timedelta | None = ...,
fill_value: Scalar | NAType | None = ...,
axis: Axis | None = ...,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about **kwargs? Can we just add **kwargs: Any or copy-paste all additional arguments from DataFrame.shift or Series.shift?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So using the actual arguments and not the kwargs was something Marco started a while ago - since it helps with readability - to know what needs to be passed, you ensure fuller typing. I have added the axis, the other argument in shift method is suffix but it does not apply in our case (does not work when period is an int).
So these are all the args we can pass and they are fully typed.
Let me know what you think about the approach.

@cmp0xff cmp0xff added the DataFrame DataFrame data structure label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DataFrame DataFrame data structure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pandas-stubs: Missing axis parameter in DataFrame.pct_change() type annotations

2 participants