Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-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" \
-i "pandas.Timedelta.max PR02" \
-i "pandas.Timedelta.min PR02" \
-i "pandas.Timedelta.resolution PR02" \
Expand Down
18 changes: 17 additions & 1 deletion pandas/core/arrays/sparse/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,22 @@ def sp_index(self) -> SparseIndex:
@property
def sp_values(self) -> np.ndarray:
"""
An ndarray containing the non- ``fill_value`` values.
An ndarray containing the non-``fill_value`` values.

This method retrieves the non-fill values from a SparseArray. SparseArrays
are designed to efficiently store large arrays of data where most of the
elements are the same (the fill value). This method allows you to access
the actual data points that differ from the fill value.

Returns
-------
ndarray
An array containing the non-fill values.

See Also
--------
Series.sparse.fill_value : The fill value for the SparseArray.
arrays.SparseArray : Represents an array with sparse data.

Examples
--------
Expand All @@ -610,6 +625,7 @@ def sp_values(self) -> np.ndarray:
>>> s.sp_values
array([1, 2])
"""

return self._sparse_values

@property
Expand Down
5 changes: 5 additions & 0 deletions pandas/core/strings/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,10 @@ 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 each string in the Series starts with a substring
that matches the given regular expression pattern. It returns a boolean
Series indicating whether each string meets the condition.

Parameters
----------
pat : str
Expand Down Expand Up @@ -1402,6 +1406,7 @@ def match(self, pat: str, case: bool = True, flags: int = 0, na=None):
2 False
dtype: bool
"""

result = self._data.array._str_match(pat, case=case, flags=flags, na=na)
return self._wrap_result(result, fill_value=na, returns_string=False)

Expand Down