diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 1c37d9bf1c4b3..d37f4bcf44ee4 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -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\ diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 5c8842162007d..e65764b56428b 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -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 -------- @@ -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 ---------- @@ -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 -------- @@ -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 ` for more information + on which values are considered missing. Returns ------- type of index + Index of {position} non-missing value. Examples --------