bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / strings / endswith
function
numpy.strings:endswith
source: build-install/usr/lib/python3.14/site-packages/numpy/_core/strings.py :490
Signature
def endswith ( a , suffix , start = 0 , end = None ) Summary
Returns a boolean array which is True where the string element in a ends with suffix, otherwise False.
Parameters
a: array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtypesuffix: array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtypestart, end: array_like, with any integer dtypeWith
start, test beginning at that position. Withend, stop comparing at that position.
Returns
out: ndarrayOutput array of bools
Examples
import numpy as np s = np.array(['foo', 'bar']) s np.strings.endswith(s, 'ar') np.strings.endswith(s, 'a', start=1, end=2)✓
See also
- str.endswith
Aliases
-
numpy.char.endswith