This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / 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_`` dtype
suffix : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
start, end : array_like, with any integer dtype

With start, test beginning at that position. With end, stop comparing at that position.

Returns

out : ndarray

Output 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