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

Function startswith

numpy/core/defchararray.py:1582–1610  ·  view source on GitHub ↗

Returns a boolean array which is `True` where the string element in `a` starts with `prefix`, otherwise `False`. Calls `str.startswith` element-wise. Parameters ---------- a : array_like of str or unicode prefix : str start, end : int, optional With optio

(a, prefix, start=0, end=None)

Source from the content-addressed store, hash-verified

1580
1581@array_function_dispatch(_startswith_dispatcher)
1582def startswith(a, prefix, start=0, end=None):
1583 """
1584 Returns a boolean array which is `True` where the string element
1585 in `a` starts with `prefix`, otherwise `False`.
1586
1587 Calls `str.startswith` element-wise.
1588
1589 Parameters
1590 ----------
1591 a : array_like of str or unicode
1592
1593 prefix : str
1594
1595 start, end : int, optional
1596 With optional `start`, test beginning at that position. With
1597 optional `end`, stop comparing at that position.
1598
1599 Returns
1600 -------
1601 out : ndarray
1602 Array of booleans
1603
1604 See Also
1605 --------
1606 str.startswith
1607
1608 """
1609 return _vec_string(
1610 a, bool_, 'startswith', [prefix, start] + _clean_args(end))
1611
1612
1613@array_function_dispatch(_strip_dispatcher)

Callers 1

startswithMethod · 0.85

Calls 2

_vec_stringFunction · 0.90
_clean_argsFunction · 0.85

Tested by

no test coverage detected