-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: Use * syntax to make reindex kwargs keyword only #50853
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
Conversation
index = labels | ||
axes: dict[Literal["index", "columns"], Any] = { | ||
"index": index, | ||
"columns": columns, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think ATM "columns" is not included in Series cases. this doesn't break anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah columns
should not be included in the Series case. Before the passed labels would be forced into the index
in the Series case
docstrings left unchanged? |
Yea but slightly improved. Went from
to more specifically what is used e.g.
|
Going to merge, but can follow up if needed |
* Use newer positional only syntax * Push logic into generic, improve docs * Clarify whatsnew * Fix shared_doc * Make axis more generic * Series has different default * Add some type ignores * Fix docstring validation * doc validation
After enforcing #17966, this makes
DataFrame.reindex
effectively keyword only except forlabels
, so removed ad-hoc logic to enforce that.Series.reindex
also has similar ad-hoc logic which can be removed.Also did some docstring cleanup for both functions.