Skip to content

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

Merged
merged 5 commits into from
Apr 8, 2020

Conversation

jbrockmendel
Copy link
Member

Follow-up to #33279.

@jreback jreback added Clean Internals Related to non-user accessible pandas implementation labels Apr 6, 2020
@jreback jreback added this to the 1.1 milestone Apr 6, 2020
# 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)
Copy link
Contributor

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

for i in range(len(ax)):
if ax[i] in value:
v = value[ax[i]]
ser = self._ixs(i, axis=1)
Copy link
Contributor

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.

Copy link
Member Author

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

Copy link
Contributor

@jreback jreback left a 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(
Copy link
Contributor

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.

@jreback jreback merged commit d537d77 into pandas-dev:master Apr 8, 2020
@jreback
Copy link
Contributor

jreback commented Apr 8, 2020

thanks

@jbrockmendel jbrockmendel deleted the replace-filter branch April 8, 2020 17:33
jbrockmendel added a commit to jbrockmendel/pandas that referenced this pull request Apr 8, 2020
jreback pushed a commit that referenced this pull request Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants