@@ -1245,8 +1245,9 @@ def contains(
1245
1245
Flags to pass through to the re module, e.g. re.IGNORECASE.
1246
1246
na : scalar, optional
1247
1247
Fill value for missing values. The default depends on dtype of the
1248
- array. For object-dtype, ``numpy.nan`` is used. For ``StringDtype``,
1249
- ``pandas.NA`` is used.
1248
+ array. For object-dtype, ``numpy.nan`` is used. For the nullable
1249
+ ``StringDtype``, ``pandas.NA`` is used. For the ``"str"`` dtype,
1250
+ ``False`` is used.
1250
1251
regex : bool, default True
1251
1252
If True, assumes the pat is a regular expression.
1252
1253
@@ -1378,8 +1379,9 @@ def match(self, pat: str, case: bool = True, flags: int = 0, na=lib.no_default):
1378
1379
Regex module flags, e.g. re.IGNORECASE.
1379
1380
na : scalar, optional
1380
1381
Fill value for missing values. The default depends on dtype of the
1381
- array. For object-dtype, ``numpy.nan`` is used. For ``StringDtype``,
1382
- ``pandas.NA`` is used.
1382
+ array. For object-dtype, ``numpy.nan`` is used. For the nullable
1383
+ ``StringDtype``, ``pandas.NA`` is used. For the ``"str"`` dtype,
1384
+ ``False`` is used.
1383
1385
1384
1386
Returns
1385
1387
-------
@@ -1422,8 +1424,9 @@ def fullmatch(self, pat, case: bool = True, flags: int = 0, na=lib.no_default):
1422
1424
Regex module flags, e.g. re.IGNORECASE.
1423
1425
na : scalar, optional
1424
1426
Fill value for missing values. The default depends on dtype of the
1425
- array. For object-dtype, ``numpy.nan`` is used. For ``StringDtype``,
1426
- ``pandas.NA`` is used.
1427
+ array. For object-dtype, ``numpy.nan`` is used. For the nullable
1428
+ ``StringDtype``, ``pandas.NA`` is used. For the ``"str"`` dtype,
1429
+ ``False`` is used.
1427
1430
1428
1431
Returns
1429
1432
-------
@@ -2586,7 +2589,7 @@ def count(self, pat, flags: int = 0):
2586
2589
2587
2590
@forbid_nonstring_types (["bytes" ])
2588
2591
def startswith (
2589
- self , pat : str | tuple [str , ...], na : Scalar | None = lib .no_default
2592
+ self , pat : str | tuple [str , ...], na : Scalar | lib . NoDefault = lib .no_default
2590
2593
) -> Series | Index :
2591
2594
"""
2592
2595
Test if the start of each string element matches a pattern.
@@ -2598,10 +2601,11 @@ def startswith(
2598
2601
pat : str or tuple[str, ...]
2599
2602
Character sequence or tuple of strings. Regular expressions are not
2600
2603
accepted.
2601
- na : object, default NaN
2604
+ na : scalar, optional
2602
2605
Object shown if element tested is not a string. The default depends
2603
2606
on dtype of the array. For object-dtype, ``numpy.nan`` is used.
2604
- For ``StringDtype``, ``pandas.NA`` is used.
2607
+ For the nullable ``StringDtype``, ``pandas.NA`` is used.
2608
+ For the ``"str"`` dtype, ``False`` is used.
2605
2609
2606
2610
Returns
2607
2611
-------
@@ -2656,7 +2660,7 @@ def startswith(
2656
2660
2657
2661
@forbid_nonstring_types (["bytes" ])
2658
2662
def endswith (
2659
- self , pat : str | tuple [str , ...], na : Scalar | None = lib .no_default
2663
+ self , pat : str | tuple [str , ...], na : Scalar | lib . NoDefault = lib .no_default
2660
2664
) -> Series | Index :
2661
2665
"""
2662
2666
Test if the end of each string element matches a pattern.
@@ -2668,10 +2672,11 @@ def endswith(
2668
2672
pat : str or tuple[str, ...]
2669
2673
Character sequence or tuple of strings. Regular expressions are not
2670
2674
accepted.
2671
- na : object, default NaN
2675
+ na : scalar, optional
2672
2676
Object shown if element tested is not a string. The default depends
2673
2677
on dtype of the array. For object-dtype, ``numpy.nan`` is used.
2674
- For ``StringDtype``, ``pandas.NA`` is used.
2678
+ For the nullable ``StringDtype``, ``pandas.NA`` is used.
2679
+ For the ``"str"`` dtype, ``False`` is used.
2675
2680
2676
2681
Returns
2677
2682
-------
0 commit comments