diff --git a/pandas/core/frame.py b/pandas/core/frame.py index d7043a8cda7b2..5a248838810e9 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -5251,8 +5251,7 @@ def swaplevel(self, i=-2, j=-1, axis=0): def reorder_levels(self, order, axis=0): """ - Rearrange index levels using input order. May not drop or - duplicate levels. + Rearrange index levels using input order. May not drop or duplicate levels. Parameters ---------- @@ -5854,9 +5853,10 @@ def pivot(self, index=None, columns=None, values=None): _shared_docs[ "pivot_table" ] = """ - Create a spreadsheet-style pivot table as a DataFrame. The levels in - the pivot table will be stored in MultiIndex objects (hierarchical - indexes) on the index and columns of the result DataFrame. + Create a spreadsheet-style pivot table as a DataFrame. + + The levels in the pivot table will be stored in MultiIndex objects + (hierarchical indexes) on the index and columns of the result DataFrame. Parameters ----------%s @@ -6249,8 +6249,9 @@ def explode(self, column: Union[str, Tuple]) -> "DataFrame": def unstack(self, level=-1, fill_value=None): """ - Pivot a level of the (necessarily hierarchical) index labels, returning - a DataFrame having a new level of column labels whose inner-most level + Pivot a level of the (necessarily hierarchical) index labels. + + Returns a DataFrame having a new level of column labels whose inner-most level consists of the pivoted index labels. If the index is not a MultiIndex, the output will be a Series @@ -6312,8 +6313,7 @@ def unstack(self, level=-1, fill_value=None): _shared_docs[ "melt" ] = """ - Unpivot a DataFrame from wide format to long format, optionally - leaving identifier variables set. + Unpivot a DataFrame from wide to long format, optionally leaving identifiers set. This function is useful to massage a DataFrame into a format where one or more columns are identifier variables (`id_vars`), while all other @@ -7908,6 +7908,7 @@ def nunique(self, axis=0, dropna=True): def idxmin(self, axis=0, skipna=True): """ Return index of first occurrence of minimum over requested axis. + NA/null values are excluded. Parameters @@ -7945,6 +7946,7 @@ def idxmin(self, axis=0, skipna=True): def idxmax(self, axis=0, skipna=True): """ Return index of first occurrence of maximum over requested axis. + NA/null values are excluded. Parameters diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 81742b5337e47..e15332a5277b9 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -4353,8 +4353,9 @@ def sort_index( def reindex(self, *args, **kwargs): """ - Conform %(klass)s to new index with optional filling logic, placing - NA/NaN in locations having no value in the previous index. A new object + Conform %(klass)s to new index with optional filling logic. + + Places NA/NaN in locations having no value in the previous index. A new object is produced unless the new index is equivalent to the current one and ``copy=False``. @@ -4669,8 +4670,7 @@ def _reindex_with_indexers( def filter(self, items=None, like=None, regex=None, axis=None): """ - Subset rows or columns of dataframe according to labels in - the specified index. + Subset the dataframe rows or columns 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. @@ -8497,8 +8497,7 @@ def resample( def first(self, offset): """ - Convenience method for subsetting initial periods of time series data - based on a date offset. + Method to subset initial periods of time series data based on a date offset. Parameters ---------- @@ -8560,8 +8559,7 @@ def first(self, offset): def last(self, offset): """ - Convenience method for subsetting final periods of time series data - based on a date offset. + Method to subset final periods of time series data based on a date offset. Parameters ----------