On this page
numpy.char.partition
char.partition(a, sep)[source]-
Partition each element in
aaroundsep.Calls
str.partitionelement-wise.For each element in
a, split the element as the first occurrence ofsep, 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
-
aarray_like, {str, unicode}-
Input array
sep{str, unicode}-
Separator to split each string element in
a.
- Returns
-
outndarray, {str, unicode}-
Output array of str or unicode, depending on input type. The output array will have an extra dimension with 3 elements per input element.
See also
© 2005–2021 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.20/reference/generated/numpy.char.partition.html