Skip to content

Commit 256f702

Browse files
committed
DOC: add char.splitlines example
[skip actions][skip azp][skip cirrus]
1 parent 04b1067 commit 256f702

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

numpy/_core/strings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,14 @@ def _splitlines(a, keepends=None):
13351335
--------
13361336
str.splitlines
13371337
1338+
Examples
1339+
--------
1340+
>>> np.char.splitlines("first line\nsecond line")
1341+
array(list(['first line', 'second line']), dtype=object)
1342+
>>> a = np.array(["first\nsecond", "third\nfourth"])
1343+
>>> np.char.splitlines(a)
1344+
array([list(['first', 'second']), list(['third', 'fourth'])], dtype=object)
1345+
13381346
"""
13391347
return _vec_string(
13401348
a, np.object_, 'splitlines', _clean_args(keepends))

0 commit comments

Comments
 (0)