Skip to content

Commit 16ec6ec

Browse files
shriyakalakatamroeschke
authored andcommitted
DOC: Remove deprecated methods w/ SA01 errors from code_checks.sh (pandas-dev#58298)
* DOC: Fix docstring error for copy method * DOC: Fix docstring error for first_valid_index methods * DOC: Fix docstring error for keys methods * Update for last_valid_index methods * Fix merge conflict * Update methods under See Also * Update methods under See Also * Update pandas/core/generic.py Co-authored-by: Matthew Roeschke <[email protected]> --------- Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 2b53c65 commit 16ec6ec

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

ci/code_checks.sh

-8
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8383
-i "pandas.DataFrame.__iter__ SA01" \
8484
-i "pandas.DataFrame.at_time PR01" \
8585
-i "pandas.DataFrame.columns SA01" \
86-
-i "pandas.DataFrame.copy SA01" \
8786
-i "pandas.DataFrame.droplevel SA01" \
88-
-i "pandas.DataFrame.first_valid_index SA01" \
8987
-i "pandas.DataFrame.hist RT03" \
9088
-i "pandas.DataFrame.infer_objects RT03" \
91-
-i "pandas.DataFrame.keys SA01" \
9289
-i "pandas.DataFrame.kurt RT03,SA01" \
9390
-i "pandas.DataFrame.kurtosis RT03,SA01" \
94-
-i "pandas.DataFrame.last_valid_index SA01" \
9591
-i "pandas.DataFrame.max RT03" \
9692
-i "pandas.DataFrame.mean RT03,SA01" \
9793
-i "pandas.DataFrame.median RT03,SA01" \
@@ -310,7 +306,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
310306
-i "pandas.Series.cat.rename_categories PR01,PR02" \
311307
-i "pandas.Series.cat.reorder_categories PR01,PR02" \
312308
-i "pandas.Series.cat.set_categories PR01,PR02" \
313-
-i "pandas.Series.copy SA01" \
314309
-i "pandas.Series.div PR07" \
315310
-i "pandas.Series.droplevel SA01" \
316311
-i "pandas.Series.dt.as_unit PR01,PR02" \
@@ -354,7 +349,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
354349
-i "pandas.Series.dtype SA01" \
355350
-i "pandas.Series.empty GL08" \
356351
-i "pandas.Series.eq PR07,SA01" \
357-
-i "pandas.Series.first_valid_index SA01" \
358352
-i "pandas.Series.floordiv PR07" \
359353
-i "pandas.Series.ge PR07,SA01" \
360354
-i "pandas.Series.gt PR07,SA01" \
@@ -364,10 +358,8 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
364358
-i "pandas.Series.is_monotonic_increasing SA01" \
365359
-i "pandas.Series.is_unique SA01" \
366360
-i "pandas.Series.item SA01" \
367-
-i "pandas.Series.keys SA01" \
368361
-i "pandas.Series.kurt RT03,SA01" \
369362
-i "pandas.Series.kurtosis RT03,SA01" \
370-
-i "pandas.Series.last_valid_index SA01" \
371363
-i "pandas.Series.le PR07,SA01" \
372364
-i "pandas.Series.list.__getitem__ SA01" \
373365
-i "pandas.Series.list.flatten SA01" \

pandas/core/generic.py

+18
Original file line numberDiff line numberDiff line change
@@ -1884,6 +1884,11 @@ def keys(self) -> Index:
18841884
Index
18851885
Info axis.
18861886
1887+
See Also
1888+
--------
1889+
DataFrame.index : The index (row labels) of the DataFrame.
1890+
DataFrame.columns: The column labels of the DataFrame.
1891+
18871892
Examples
18881893
--------
18891894
>>> d = pd.DataFrame(
@@ -6392,6 +6397,11 @@ def copy(self, deep: bool = True) -> Self:
63926397
Series or DataFrame
63936398
Object type matches caller.
63946399
6400+
See Also
6401+
--------
6402+
copy.copy : Return a shallow copy of an object.
6403+
copy.deepcopy : Return a deep copy of an object.
6404+
63956405
Notes
63966406
-----
63976407
When ``deep=True``, data is copied but actual Python objects
@@ -11616,6 +11626,14 @@ def first_valid_index(self) -> Hashable:
1161611626
type of index
1161711627
Index of {position} non-missing value.
1161811628
11629+
See Also
11630+
--------
11631+
DataFrame.last_valid_index : Return index for last non-NA value or None, if
11632+
no non-NA value is found.
11633+
Series.last_valid_index : Return index for last non-NA value or None, if no
11634+
non-NA value is found.
11635+
DataFrame.isna : Detect missing values.
11636+
1161911637
Examples
1162011638
--------
1162111639
For Series:

pandas/core/series.py

+4
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,10 @@ def keys(self) -> Index:
17461746
Index
17471747
Index of the Series.
17481748
1749+
See Also
1750+
--------
1751+
Series.index : The index (axis labels) of the Series.
1752+
17491753
Examples
17501754
--------
17511755
>>> s = pd.Series([1, 2, 3], index=[0, 1, 2])

0 commit comments

Comments
 (0)