@@ -1242,9 +1242,9 @@ def contains(
1242
1242
Flags to pass through to the re module, e.g. re.IGNORECASE.
1243
1243
na : scalar, optional
1244
1244
Fill value for missing values. The default depends on dtype of the
1245
- array. For object- dtype, ``numpy.nan `` is used. For the nullable
1246
- ``StringDtype`` , ``pandas.NA `` is used. For the ``"str"`` dtype ,
1247
- ``False `` is used.
1245
+ array. For the ``"str"`` dtype, ``False `` is used. For object
1246
+ dtype , ``numpy.nan `` is used. For the nullable ``StringDtype`` ,
1247
+ ``pandas.NA `` is used.
1248
1248
regex : bool, default True
1249
1249
If True, assumes the pat is a regular expression.
1250
1250
@@ -1293,18 +1293,6 @@ def contains(
1293
1293
4 False
1294
1294
dtype: bool
1295
1295
1296
- Specifying `na` to be `False` instead of `NaN` replaces NaN values
1297
- with `False`. If Series or Index does not contain NaN values
1298
- the resultant dtype will be `bool`, otherwise, an `object` dtype.
1299
-
1300
- >>> s1.str.contains("og", na=False, regex=True)
1301
- 0 False
1302
- 1 True
1303
- 2 False
1304
- 3 False
1305
- 4 False
1306
- dtype: bool
1307
-
1308
1296
Returning 'house' or 'dog' when either expression occurs in a string.
1309
1297
1310
1298
>>> s1.str.contains("house|dog", regex=True)
@@ -1381,9 +1369,9 @@ def match(self, pat: str, case: bool = True, flags: int = 0, na=lib.no_default):
1381
1369
Regex module flags, e.g. re.IGNORECASE.
1382
1370
na : scalar, optional
1383
1371
Fill value for missing values. The default depends on dtype of the
1384
- array. For object- dtype, ``numpy.nan `` is used. For the nullable
1385
- ``StringDtype`` , ``pandas.NA `` is used. For the ``"str"`` dtype ,
1386
- ``False `` is used.
1372
+ array. For the ``"str"`` dtype, ``False `` is used. For object
1373
+ dtype , ``numpy.nan `` is used. For the nullable ``StringDtype`` ,
1374
+ ``pandas.NA `` is used.
1387
1375
1388
1376
Returns
1389
1377
-------
@@ -1431,9 +1419,9 @@ def fullmatch(self, pat, case: bool = True, flags: int = 0, na=lib.no_default):
1431
1419
Regex module flags, e.g. re.IGNORECASE.
1432
1420
na : scalar, optional
1433
1421
Fill value for missing values. The default depends on dtype of the
1434
- array. For object- dtype, ``numpy.nan `` is used. For the nullable
1435
- ``StringDtype`` , ``pandas.NA `` is used. For the ``"str"`` dtype ,
1436
- ``False `` is used.
1422
+ array. For the ``"str"`` dtype, ``False `` is used. For object
1423
+ dtype , ``numpy.nan `` is used. For the nullable ``StringDtype`` ,
1424
+ ``pandas.NA `` is used.
1437
1425
1438
1426
Returns
1439
1427
-------
@@ -2671,9 +2659,9 @@ def startswith(
2671
2659
accepted.
2672
2660
na : scalar, optional
2673
2661
Object shown if element tested is not a string. The default depends
2674
- on dtype of the array. For object- dtype, ``numpy.nan `` is used.
2675
- For the nullable ``StringDtype`` , ``pandas.NA `` is used.
2676
- For the ``"str"`` dtype , ``False `` is used.
2662
+ on dtype of the array. For the ``"str"`` dtype, ``False `` is used.
2663
+ For object dtype , ``numpy.nan `` is used. For the nullable
2664
+ ``StringDtype`` , ``pandas.NA `` is used.
2677
2665
2678
2666
Returns
2679
2667
-------
@@ -2710,15 +2698,6 @@ def startswith(
2710
2698
2 False
2711
2699
3 False
2712
2700
dtype: bool
2713
-
2714
- Specifying `na` to be `False` instead of `NaN`.
2715
-
2716
- >>> s.str.startswith("b", na=False)
2717
- 0 True
2718
- 1 False
2719
- 2 False
2720
- 3 False
2721
- dtype: bool
2722
2701
"""
2723
2702
if not isinstance (pat , (str , tuple )):
2724
2703
msg = f"expected a string or tuple, not { type (pat ).__name__ } "
@@ -2742,9 +2721,9 @@ def endswith(
2742
2721
accepted.
2743
2722
na : scalar, optional
2744
2723
Object shown if element tested is not a string. The default depends
2745
- on dtype of the array. For object- dtype, ``numpy.nan `` is used.
2746
- For the nullable ``StringDtype`` , ``pandas.NA `` is used.
2747
- For the ``"str"`` dtype , ``False `` is used.
2724
+ on dtype of the array. For the ``"str"`` dtype, ``False `` is used.
2725
+ For object dtype , ``numpy.nan `` is used. For the nullable
2726
+ ``StringDtype`` , ``pandas.NA `` is used.
2748
2727
2749
2728
Returns
2750
2729
-------
@@ -2781,15 +2760,6 @@ def endswith(
2781
2760
2 True
2782
2761
3 False
2783
2762
dtype: bool
2784
-
2785
- Specifying `na` to be `False` instead of `NaN`.
2786
-
2787
- >>> s.str.endswith("t", na=False)
2788
- 0 True
2789
- 1 False
2790
- 2 False
2791
- 3 False
2792
- dtype: bool
2793
2763
"""
2794
2764
if not isinstance (pat , (str , tuple )):
2795
2765
msg = f"expected a string or tuple, not { type (pat ).__name__ } "
0 commit comments