Skip to content

DOC: Resolve RT03 errors for selected methods #57782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 0 additions & 5 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -614,15 +614,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Partially validate docstrings (RT03)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=RT03 --ignore_functions \
pandas.DataFrame.expanding\
pandas.DataFrame.filter\
pandas.DataFrame.first_valid_index\
pandas.DataFrame.get\
pandas.DataFrame.hist\
pandas.DataFrame.infer_objects\
pandas.DataFrame.kurt\
pandas.DataFrame.kurtosis\
pandas.DataFrame.last_valid_index\
pandas.DataFrame.mask\
pandas.DataFrame.max\
pandas.DataFrame.mean\
Expand Down
25 changes: 18 additions & 7 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4183,15 +4183,19 @@ def get(self, key, default=None):
"""
Get item from object for given key (ex: DataFrame column).

Returns default value if not found.
Returns ``default`` value if not found.

Parameters
----------
key : object
Key for which item should be returned.
default : object, default None
Default value to return if key is not found.

Returns
-------
same type as items contained in object
Item for given key or ``default`` value, if key is not found.

Examples
--------
Expand Down Expand Up @@ -5362,10 +5366,11 @@ def filter(
axis: Axis | None = None,
) -> Self:
"""
Subset the dataframe rows or columns according to the specified index labels.
Subset the DataFrame or Series according to the specified index labels.

Note that this routine does not filter a dataframe on its
contents. The filter is applied to the labels of the index.
For DataFrame, filter rows or columns depending on ``axis`` argument.
Note that this routine does not filter based on content.
The filter is applied to the labels of the index.

Parameters
----------
Expand All @@ -5378,11 +5383,13 @@ def filter(
axis : {0 or 'index', 1 or 'columns', None}, default None
The axis to filter on, expressed either as an index (int)
or axis name (str). By default this is the info axis, 'columns' for
DataFrame. For `Series` this parameter is unused and defaults to `None`.
``DataFrame``. For ``Series`` this parameter is unused and defaults to
``None``.

Returns
-------
same type as input object
Same type as caller
The filtered subset of the DataFrame or Series.

See Also
--------
Expand Down Expand Up @@ -11744,11 +11751,15 @@ def _find_valid_index(self, *, how: str) -> Hashable:
@doc(position="first", klass=_shared_doc_kwargs["klass"])
def first_valid_index(self) -> Hashable:
"""
Return index for {position} non-NA value or None, if no non-NA value is found.
Return index for {position} non-missing value or None, if no value is found.

See the :ref:`User Guide <missing_data>` for more information
on which values are considered missing.

Returns
-------
type of index
Index of {position} non-missing value.

Examples
--------
Expand Down