replace_operator¶
Replaces values in multiple dataframes based on Pandas replace method.
-
class
tasrif.processing_pipeline.pandas.replace_operator.
ReplaceOperator
(**kwargs)¶ Replaces a value by another on the datasets based on Pandas replace method.
Examples
>>> df = pd.DataFrame({'id': [1, 2, 3], 'colors': ['red', 'white', 'blue'], "importance": [1, 3, 2]}) >>> df = ReplaceOperator(to_replace="red", value="green").process(df)[0] >>> df id colors importance 1 green 1 3 blue 2 2 white 3
-
__init__
(**kwargs)¶ Replaces values in the datasets using the Pandas function replace.
- Parameters
**kwargs – key word arguments passed to pandas DataFrame.replace method
-