Feature Type
-
[X] Adding new functionality to pandas
-
[ ] Changing existing functionality in pandas
-
[ ] Removing existing functionality in pandas
Problem Description
I wish there is one parameter in pd.replace that helps to ignore some rows while replacing it.
Feature Description
pd.replace('hello', 'hai', inplace=True, ignore=['col1','col2'])
Alternative Solutions
It can satisfy with an additional iteration through the columns
Additional Context
No response
Comment From: izam-mohammed
May I work on it ?
Comment From: attack68
I suspect adding a parameter will not get much support.
The documentation for replace
suggests "[replace
] differs from updating with .loc or .iloc, which require you to specify a location to update with some value." By adding an ignore
parameter you are converting the method into something other than it is specifically stated to be used for and providing yet another path to achieve a result that is already available using more generic methods.
Comment From: mroeschke
Agreed with @attack68 and would be -1 for this feature as this could already be achieved by selecting the columns you want before replacing. Thanks for the suggestion but closing