-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: replace column-wise, remove BlockManager.apply filter kwarg #33340
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
pandas/core/generic.py
Outdated
# Note: we only get here with self.ndim == 2 | ||
for i in range(len(ax)): | ||
if ax[i] in to_replace: | ||
ser = self._ixs(i, axis=1) |
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 would just use .iloc
here
pandas/core/generic.py
Outdated
for i in range(len(ax)): | ||
if ax[i] in value: | ||
v = value[ax[i]] | ||
ser = self._ixs(i, axis=1) |
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.
same,
can you factor this to a function instead.
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.
refactored + green
i think in follow-up might be able to use this new helper method in one or two more places
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.
lgtm. a question.
@@ -4025,6 +4025,41 @@ def replace( | |||
method=method, | |||
) | |||
|
|||
def _replace_columnwise( |
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 may make sense to move this somewhere, maybe missing.py just to try to reduce size in this module. anyhow for another day.
thanks |
Follow-up to #33279.