From 4f91c619026b3d54e08feaa488c64a9711a10bf6 Mon Sep 17 00:00:00 2001 From: tuhinsharma121 Date: Mon, 13 May 2024 00:18:47 +0530 Subject: [PATCH 1/2] DOC: add SA01 for pandas.SparseDtype --- pandas/core/dtypes/dtypes.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index dc7e9afac331b..e10080604260a 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -1665,7 +1665,10 @@ class SparseDtype(ExtensionDtype): """ Dtype for data stored in :class:`SparseArray`. - This dtype implements the pandas ExtensionDtype interface. + `SparseDtype` is used as the data type for :class:`SparseArray`, enabling + more efficient storage of data that contains a significant number of + repetitive values typically represented by a fill value. It supports any + scalar dtype as the underlying data type of the non-fill values. Parameters ---------- @@ -1695,6 +1698,11 @@ class SparseDtype(ExtensionDtype): ------- None + See Also + -------- + arrays.SparseArray : The array structure that uses SparseDtype + for data representation. + Examples -------- >>> ser = pd.Series([1, 0, 0], dtype=pd.SparseDtype(dtype=int, fill_value=0)) From ab079757fed8b5e96a3574ab7b42e3251c9e42be Mon Sep 17 00:00:00 2001 From: tuhinsharma121 Date: Mon, 13 May 2024 00:18:53 +0530 Subject: [PATCH 2/2] DOC: remove SA01 for pandas.SparseDtype --- ci/code_checks.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 857a2d3216b89..2998d8470d36d 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -245,7 +245,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.truediv PR07" \ -i "pandas.Series.update PR07,SA01" \ -i "pandas.Series.var PR01,RT03,SA01" \ - -i "pandas.SparseDtype SA01" \ -i "pandas.Timedelta PR07,SA01" \ -i "pandas.Timedelta.as_unit SA01" \ -i "pandas.Timedelta.asm8 SA01" \