pandas 1.4.2

ParametersReturns
endswith(self, pat, na=None)

Equivalent to str.endswith .

Parameters

pat : str

Character sequence. Regular expressions are not accepted.

na : object, default NaN

Object shown if element tested is not a string. The default depends on dtype of the array. For object-dtype, numpy.nan is used. For StringDtype , pandas.NA is used.

Returns

Series or Index of bool

A Series of booleans indicating whether the given pattern matches the end of each string element.

Test if the end of each string element matches a pattern.

See Also

Series.str.contains

Tests if string element contains a pattern.

Series.str.startswith

Same as endswith, but tests the start of string.

str.endswith

Python standard library string method.

Examples

This example is valid syntax, but we were not able to check execution
>>> s = pd.Series(['bat', 'bear', 'caT', np.nan])
... s 0 bat 1 bear 2 caT 3 NaN dtype: object
This example is valid syntax, but we were not able to check execution
>>> s.str.endswith('t')
0     True
1    False
2    False
3      NaN
dtype: object

Specifying :None:None:`na` to be :None:None:`False` instead of NaN .

This example is valid syntax, but we were not able to check execution
>>> s.str.endswith('t', na=False)
0     True
1    False
2    False
3    False
dtype: bool
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/strings/accessor.py#2288
type: <class 'function'>
Commit: