Skip to content

Commit

Permalink
update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Aug 26, 2024
1 parent b235735 commit 562118e
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions pandas/core/strings/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,8 +1245,9 @@ def contains(
Flags to pass through to the re module, e.g. re.IGNORECASE.
na : scalar, optional
Fill value for missing values. The default depends on dtype of the
array. For object-dtype, ``numpy.nan`` is used. For ``StringDtype``,
``pandas.NA`` is used.
array. For object-dtype, ``numpy.nan`` is used. For the nullable
``StringDtype``, ``pandas.NA`` is used. For the ``"str"`` dtype,
``False`` is used.
regex : bool, default True
If True, assumes the pat is a regular expression.
Expand Down Expand Up @@ -1378,8 +1379,9 @@ def match(self, pat: str, case: bool = True, flags: int = 0, na=lib.no_default):
Regex module flags, e.g. re.IGNORECASE.
na : scalar, optional
Fill value for missing values. The default depends on dtype of the
array. For object-dtype, ``numpy.nan`` is used. For ``StringDtype``,
``pandas.NA`` is used.
array. For object-dtype, ``numpy.nan`` is used. For the nullable
``StringDtype``, ``pandas.NA`` is used. For the ``"str"`` dtype,
``False`` is used.
Returns
-------
Expand Down Expand Up @@ -1422,8 +1424,9 @@ def fullmatch(self, pat, case: bool = True, flags: int = 0, na=lib.no_default):
Regex module flags, e.g. re.IGNORECASE.
na : scalar, optional
Fill value for missing values. The default depends on dtype of the
array. For object-dtype, ``numpy.nan`` is used. For ``StringDtype``,
``pandas.NA`` is used.
array. For object-dtype, ``numpy.nan`` is used. For the nullable
``StringDtype``, ``pandas.NA`` is used. For the ``"str"`` dtype,
``False`` is used.
Returns
-------
Expand Down Expand Up @@ -2586,7 +2589,7 @@ def count(self, pat, flags: int = 0):

@forbid_nonstring_types(["bytes"])
def startswith(
self, pat: str | tuple[str, ...], na: Scalar | None = lib.no_default
self, pat: str | tuple[str, ...], na: Scalar | lib.NoDefault = lib.no_default
) -> Series | Index:
"""
Test if the start of each string element matches a pattern.
Expand All @@ -2598,10 +2601,11 @@ def startswith(
pat : str or tuple[str, ...]
Character sequence or tuple of strings. Regular expressions are not
accepted.
na : object, default NaN
na : scalar, optional
Object shown if element tested is not a string. The default depends
on dtype of the array. For object-dtype, ``numpy.nan`` is used.
For ``StringDtype``, ``pandas.NA`` is used.
For the nullable ``StringDtype``, ``pandas.NA`` is used.
For the ``"str"`` dtype, ``False`` is used.
Returns
-------
Expand Down Expand Up @@ -2656,7 +2660,7 @@ def startswith(

@forbid_nonstring_types(["bytes"])
def endswith(
self, pat: str | tuple[str, ...], na: Scalar | None = lib.no_default
self, pat: str | tuple[str, ...], na: Scalar | lib.NoDefault = lib.no_default
) -> Series | Index:
"""
Test if the end of each string element matches a pattern.
Expand All @@ -2668,10 +2672,11 @@ def endswith(
pat : str or tuple[str, ...]
Character sequence or tuple of strings. Regular expressions are not
accepted.
na : object, default NaN
na : scalar, optional
Object shown if element tested is not a string. The default depends
on dtype of the array. For object-dtype, ``numpy.nan`` is used.
For ``StringDtype``, ``pandas.NA`` is used.
For the nullable ``StringDtype``, ``pandas.NA`` is used.
For the ``"str"`` dtype, ``False`` is used.
Returns
-------
Expand Down

0 comments on commit 562118e

Please sign in to comment.