From 28992077e195375df66d8e3acfc40cc23e4d2441 Mon Sep 17 00:00:00 2001 From: Daniel Urbonas Date: Thu, 3 Oct 2024 00:31:27 +0000 Subject: [PATCH] DOCS: fix docstring validation errors for pandas.Series #59595 --- ci/code_checks.sh | 1 - pandas/core/arrays/sparse/array.py | 6 ++++++ pandas/core/strings/accessor.py | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index fcbeb20d083d6..3a3ac38bf1b8b 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -104,7 +104,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.dt.tz_localize PR01,PR02" \ -i "pandas.Series.dt.unit GL08" \ -i "pandas.Series.pad PR01,SA01" \ - -i "pandas.Series.sparse.fill_value SA01" \ -i "pandas.Series.sparse.from_coo PR07,SA01" \ -i "pandas.Series.sparse.npoints SA01" \ -i "pandas.Series.sparse.sp_values SA01" \ diff --git a/pandas/core/arrays/sparse/array.py b/pandas/core/arrays/sparse/array.py index a09dc20af3b36..cc30586ece5ed 100644 --- a/pandas/core/arrays/sparse/array.py +++ b/pandas/core/arrays/sparse/array.py @@ -623,6 +623,12 @@ def fill_value(self): For memory savings, this should be the most common value in the array. + See Also + -------- + Series.sparse : Accessor for handling sparse data. + Series.sparse.npoints : The number of non- ``fill_value`` points. + Series.sparse.sp_values : An ndarray containing the non- ``fill_value`` values. + Examples -------- >>> ser = pd.Series([0, 0, 2, 2, 2], dtype="Sparse[int]") diff --git a/pandas/core/strings/accessor.py b/pandas/core/strings/accessor.py index bdb88e981bcda..55c6a6c8f931c 100644 --- a/pandas/core/strings/accessor.py +++ b/pandas/core/strings/accessor.py @@ -1363,6 +1363,14 @@ def match(self, pat: str, case: bool = True, flags: int = 0, na=None): """ Determine if each string starts with a match of a regular expression. + This method checks if the start of each string in the Series or + Index matches the specified regular expression (Regex) pattern, + allowing for complex string matching rules. + + Additionally, case sensitivity can be specified, Regex module flags can + be used to modify matching behavior, and a fill value for missing values + can be provided. + Parameters ---------- pat : str