ibis.expr.api.StringValue.translate¶
-
StringValue.
translate
(from_str, to_str)¶ Returns string with set of ‘from’ characters replaced by set of ‘to’ characters. from_str[x] is replaced by to_str[x]. To avoid unexpected behavior, from_str should be shorter than to_string.
- Parameters
from_str (string) –
to_str (string) –
Examples
>>> import ibis >>> table = ibis.table([('string_col', 'string')]) >>> expr = table.string_col.translate('a', 'b') >>> expr = table.string_col.translate('a', 'bc')
- Returns
translated
- Return type
string