| [ Web Proxy ] |
| Viewing: https://numpy.org/doc/stable/reference/generated/../c-api/../generated/numpy.char.rpartition.html | [Back] [Original] |
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.
StringDType, bytes_, or str_ dtypeInput array
Right-most separator to split each element in array.
Output array of StringDType, bytes_ or str_ dtype,
depending on input types. The output array will have an extra
dimension with 3 elements per input element.
See also
Examples
>>> import numpy as np
>>> a = np.array(['aAaAaA', ' aA ', 'abBABba'])
>>> np.char.rpartition(a, 'A')
array([['aAaAa', 'A', ''],
[' a', 'A', ' '],
['abB', 'A', 'Bba']], dtype='<U5')
| Web Proxy Viewer | New URL | Original Page |