bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / strings / _splitlines
_ArrayFunctionDispatcher
numpy.strings:_splitlines
source: build-install/usr/lib/python3.14/site-packages/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)✓
array([list(['first', 'second']), list(['third', 'fourth'])], dtype=object)
See also
- str.splitlines
Aliases
numpy.char.splitlines