MCPcopy Create free account
hub / github.com/numpy/numpy / split

Function split

numpy/core/defchararray.py:1509–1540  ·  view source on GitHub ↗

For each element in `a`, return a list of the words in the string, using `sep` as the delimiter string. Calls `str.split` element-wise. Parameters ---------- a : array_like of str or unicode sep : str or unicode, optional If `sep` is not specified or None, any

(a, sep=None, maxsplit=None)

Source from the content-addressed store, hash-verified

1507
1508@array_function_dispatch(_split_dispatcher)
1509def split(a, sep=None, maxsplit=None):
1510 """
1511 For each element in `a`, return a list of the words in the
1512 string, using `sep` as the delimiter string.
1513
1514 Calls `str.split` element-wise.
1515
1516 Parameters
1517 ----------
1518 a : array_like of str or unicode
1519
1520 sep : str or unicode, optional
1521 If `sep` is not specified or None, any whitespace string is a
1522 separator.
1523
1524 maxsplit : int, optional
1525 If `maxsplit` is given, at most `maxsplit` splits are done.
1526
1527 Returns
1528 -------
1529 out : ndarray
1530 Array of list objects
1531
1532 See Also
1533 --------
1534 str.split, rsplit
1535
1536 """
1537 # This will return an array of lists of different sizes, so we
1538 # leave it as an object array
1539 return _vec_string(
1540 a, object_, 'split', [sep] + _clean_args(maxsplit))
1541
1542
1543def _splitlines_dispatcher(a, keepends=None):

Callers 1

splitMethod · 0.70

Calls 2

_vec_stringFunction · 0.90
_clean_argsFunction · 0.85

Tested by

no test coverage detected