Skip to content

Commit 3e13cf4

Browse files
gboekermroeschke
authored andcommitted
DOC: Enforce Numpy Docstring Validation for pandas.Series (pandas-dev#58537)
* add see also section for pandas.Series.cat * fix docstring errors for pandas.Series.__iter__ * remove 'pandas' from see also * Improve See Also Co-authored-by: Matthew Roeschke <[email protected]> * Improve See Also --------- Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 5ef9679 commit 3e13cf4

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

ci/code_checks.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
163163
-i "pandas.RangeIndex.start SA01" \
164164
-i "pandas.RangeIndex.step SA01" \
165165
-i "pandas.RangeIndex.stop SA01" \
166-
-i "pandas.Series.__iter__ RT03,SA01" \
167166
-i "pandas.Series.add PR07" \
168167
-i "pandas.Series.case_when RT03" \
169-
-i "pandas.Series.cat PR07,SA01" \
168+
-i "pandas.Series.cat PR07" \
170169
-i "pandas.Series.cat.add_categories PR01,PR02" \
171170
-i "pandas.Series.cat.as_ordered PR01" \
172171
-i "pandas.Series.cat.as_unordered PR01" \

pandas/core/arrays/categorical.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ def add_categories(self, new_categories) -> Self:
13101310
Parameters
13111311
----------
13121312
new_categories : category or list-like of category
1313-
The new categories to be included.
1313+
The new categories to be included.
13141314
13151315
Returns
13161316
-------
@@ -2864,6 +2864,11 @@ class CategoricalAccessor(PandasDelegate, PandasObject, NoNewAttributesMixin):
28642864
----------
28652865
data : Series or CategoricalIndex
28662866
2867+
See Also
2868+
--------
2869+
Series.dt : Accessor object for datetimelike properties of the Series values.
2870+
Series.sparse : Accessor for sparse matrix data types.
2871+
28672872
Examples
28682873
--------
28692874
>>> s = pd.Series(list("abbccc")).astype("category")

pandas/core/base.py

+5
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,11 @@ def __iter__(self) -> Iterator:
870870
Returns
871871
-------
872872
iterator
873+
An iterator yielding scalar values from the Series.
874+
875+
See Also
876+
--------
877+
Series.items : Lazily iterate over (index, value) tuples.
873878
874879
Examples
875880
--------

0 commit comments

Comments
 (0)