{ } Raw JSON

bundles / numpy 2.4.4 / 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_`` dtype
keepends : bool, optional

Line breaks are not included in the resulting list unless keepends is given and true.

Returns

out : ndarray

Array 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