| [ Web Proxy ] |
| Viewing: https://numpy.org/doc/stable/reference/generated/../generated/numpy.strings.partition.html | [Back] [Original] |
Partition each element in a around sep.
For each element in a, split the element at the first
occurrence of sep, and return a 3-tuple containing the part
before the separator, the separator itself, and the part after
the separator. If the separator is not found, the first item of
the tuple will contain the whole string, and the second and third
ones will be the empty string.
StringDType, bytes_, or str_ dtypeInput array
StringDType, bytes_, or str_ dtypeSeparator to split each string element in a.
array with StringDType, bytes_ or str_ dtype with the
part before the separator
array with StringDType, bytes_ or str_ dtype with the
separator
array with StringDType, bytes_ or str_ dtype with the
part after the separator
See also
Examples
>>> import numpy as np
>>> x = np.array(["Numpy is nice!"])
>>> np.strings.partition(x, " ")
(array(['Numpy'], dtype='<U5'),
array([' '], dtype='<U1'),
array(['is nice!'], dtype='<U8'))
| Web Proxy Viewer | New URL | Original Page |