SciPy

This is documentation for an old release of NumPy (version 1.17). Read this page in the documentation of the latest stable release (version 2.2).

numpy.char.rpartition

numpy.char.rpartition(a, sep)

Partition (split) each element around the right-most separator.

Calls str.rpartition element-wise.

For each element in a, split the element as the last occurrence of sep, and return 3 strings containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return 3 strings containing the string itself, followed by two empty strings.

Parameters:
a : array_like of str or unicode

Input array

sep : str or unicode

Right-most separator to split each element in array.

Returns:
out : ndarray

Output array of string or unicode, depending on input type. The output array will have an extra dimension with 3 elements per input element.

See also

str.rpartition

Previous topic

numpy.char.rjust

Next topic

numpy.char.rsplit