Skip to content

Commit 562118e

Browse files
update docstrings
1 parent b235735 commit 562118e

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

pandas/core/strings/accessor.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,8 +1245,9 @@ def contains(
12451245
Flags to pass through to the re module, e.g. re.IGNORECASE.
12461246
na : scalar, optional
12471247
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.
12501251
regex : bool, default True
12511252
If True, assumes the pat is a regular expression.
12521253
@@ -1378,8 +1379,9 @@ def match(self, pat: str, case: bool = True, flags: int = 0, na=lib.no_default):
13781379
Regex module flags, e.g. re.IGNORECASE.
13791380
na : scalar, optional
13801381
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.
13831385
13841386
Returns
13851387
-------
@@ -1422,8 +1424,9 @@ def fullmatch(self, pat, case: bool = True, flags: int = 0, na=lib.no_default):
14221424
Regex module flags, e.g. re.IGNORECASE.
14231425
na : scalar, optional
14241426
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.
14271430
14281431
Returns
14291432
-------
@@ -2586,7 +2589,7 @@ def count(self, pat, flags: int = 0):
25862589

25872590
@forbid_nonstring_types(["bytes"])
25882591
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
25902593
) -> Series | Index:
25912594
"""
25922595
Test if the start of each string element matches a pattern.
@@ -2598,10 +2601,11 @@ def startswith(
25982601
pat : str or tuple[str, ...]
25992602
Character sequence or tuple of strings. Regular expressions are not
26002603
accepted.
2601-
na : object, default NaN
2604+
na : scalar, optional
26022605
Object shown if element tested is not a string. The default depends
26032606
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.
26052609
26062610
Returns
26072611
-------
@@ -2656,7 +2660,7 @@ def startswith(
26562660

26572661
@forbid_nonstring_types(["bytes"])
26582662
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
26602664
) -> Series | Index:
26612665
"""
26622666
Test if the end of each string element matches a pattern.
@@ -2668,10 +2672,11 @@ def endswith(
26682672
pat : str or tuple[str, ...]
26692673
Character sequence or tuple of strings. Regular expressions are not
26702674
accepted.
2671-
na : object, default NaN
2675+
na : scalar, optional
26722676
Object shown if element tested is not a string. The default depends
26732677
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.
26752680
26762681
Returns
26772682
-------

0 commit comments

Comments
 (0)