pandas.Series.str.removeprefix

pandas 3.1.1 · Series and accessors · method

Remove the specified prefix once where it is present.

Call syntax

Series.str.removeprefix(prefix)

Run the example

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

Parameters

ParameterRequirementAccepted values and behavior
prefix Required
Positional or keyword
str

Add text before generated labels or test for a beginning substring.

Returns

Series/Index: object