pyarrow.compute.utf8_replace_slice#

pyarrow.compute.utf8_replace_slice(strings, /, start, stop, replacement, *, options=None, memory_pool=None)#

Replace a slice of a string.

For each string in strings, replace a slice of the string defined by start and stop indices with the given replacement. start is inclusive and stop is exclusive, and both are measured in UTF8 characters. Null values emit null.

Parameters:
stringsArray-like or scalar-like

Argument to compute function.

startint

Index to start slicing at (inclusive).

stopint

Index to stop slicing at (exclusive).

replacementstr

What to replace the slice with.

optionspyarrow.compute.ReplaceSliceOptions, optional

Alternative way of passing options.

memory_poolpyarrow.MemoryPool, optional

If not passed, will allocate memory from the default memory pool.