pandas.Series.str.find

pandas 3.1.1 · Series and accessors · method

Get the first position of a substring, using -1 where it cannot be found.

Call syntax

Series.str.find(sub, start=0, end=None)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
sub Required
Positional or keyword
str

Provide the substring used by a string search.

start Optional
Positional or keyword
Default 0
int

Supply the start point of a range, slice, or calculation.

end Optional
Positional or keyword
Default None
int

Supply the endpoint of the range or calculation.

Returns

Series or Index of int.