bundles / numpy 2.4.3 / numpy / strings / _splitlines
_ArrayFunctionDispatcher
numpy.strings:_splitlines
source: /numpy/_core/strings.py :1494
Signature
def _splitlines ( a , keepends = None ) Summary
For each element in a, return a list of the lines in the element, breaking at line boundaries.
Extended Summary
Calls str.splitlines element-wise.
Parameters
a: array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtypekeepends: bool, optionalLine breaks are not included in the resulting list unless keepends is given and true.
Returns
out: ndarrayArray of list objects
Examples
np.char.splitlines("first line\nsecond line") a = np.array(["first\nsecond", "third\nfourth"]) np.char.splitlines(a)✓
See also
- str.splitlines
Aliases
-
numpy.char.splitlines