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 instrings, replace non-overlapping substrings that matchthe given regular expressionpattern with the givenreplacement.Ifmax_replacements is given and not equal to -1, it limits themaximum 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
intorNone, defaultNone The maximum number of strings to replace in eachinput 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.
On this page

