Skip to content

Commit

Permalink
docs: improve Expr.substitute() docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCrews authored and cpcloud committed Feb 10, 2023
1 parent c2e5065 commit b954edd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ibis/expr/types/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,21 +289,24 @@ def notin(self, values: Value | Sequence[Value]) -> ir.BooleanValue:

def substitute(
self,
value: Value,
value: Value | dict,
replacement: Value | None = None,
else_: Value | None = None,
):
"""Replace one or more values in a value expression.
"""Replace values given in `values` with `replacement`.
This is similar to the pandas `replace` method.
Parameters
----------
value
Expression or mapping
Expression or dict.
replacement
Expression. If an expression is passed to value, this must be
If an expression is passed to value, this must be
passed.
else_
Expression
If an original value does not match `value`, then `else_` is used.
The default of `None` means leave the original value unchanged.
Returns
-------
Expand Down

0 comments on commit b954edd

Please sign in to comment.