maxframe.liteframe.LiteFrame.replace#
- LiteFrame.replace(to_replace=None, value=None)#
Replace values in the LiteFrame.
When
to_replaceisNone, behaves likefillna(replaces only NA/null values). Whento_replaceis a scalar, replaces all occurrences of that value withvalueacross every column.- Parameters:
to_replace (scalar, optional) – Value to replace. When
None(the default), only NA/null values are replaced, behaving likefillna(). Only scalarto_replaceis supported.value (scalar, optional) – Replacement value used in place of
to_replace(or in place of NA whento_replaceisNone).
- Returns:
LiteFrame with matching values replaced.
- Return type:
Examples
>>> import maxframe.liteframe as mlf >>> lf = mlf.LiteFrame({'a': [1, 2, 1], 'b': [1, 1, 2]}) >>> result = lf.replace(1, 99) >>> result.execute() a b 0 99 99 1 2 99 2 99 2