pandas.Series.str.startswith
pandas 3.1.1 · Series and accessors · method
Check whether each string begins with the supplied prefix or any of the supplied prefixes.
Call syntax
Series.str.startswith(pat, na=…)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
pat |
Required Positional or keyword |
str or tuple[str, ...] Specify the substring or regular expression to match. |
na |
Optional Positional or keyword |
scalar Supply the value to use for records whose input is missing. |
Returns
Series or Index of bool