pyarrow.compute.replace_substring_regex#
- pyarrow.compute.replace_substring_regex(strings, /, pattern, replacement, *, max_replacements=None, options=None, memory_pool=None)#
Replace matching non-overlapping substrings with replacement.
For each string in strings, replace non-overlapping substrings that match the given regular expression pattern with the given replacement. If max_replacements is given and not equal to -1, it limits the maximum amount replacements per input, counted from the left. Null values emit null.
- Parameters
- stringsArray-like or scalar-like
Argument to compute function.
- pattern
str
Substring pattern to look for inside input values.
- replacement
str
What to replace the pattern with.
- max_replacements
int
orNone
, defaultNone
The maximum number of strings to replace in each input value (unlimited if None).
- options
pyarrow.compute.ReplaceSubstringOptions
, optional Alternative way of passing options.
- memory_pool
pyarrow.MemoryPool
, optional If not passed, will allocate memory from the default memory pool.