From 35c06ad538935c4ab9d0759bde84886acbb52533 Mon Sep 17 00:00:00 2001 From: uncjackg Date: Tue, 24 May 2022 21:11:57 -0400 Subject: [PATCH 01/11] make series docs consistent add series unused param info to DF docs --- pandas/core/generic.py | 27 +++++++++++++++++---------- pandas/core/series.py | 42 ++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 1f524d07bfd3a..510aaf39a32e1 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -727,7 +727,8 @@ def set_axis(self, labels, axis: Axis = 0, inplace: bool_t = False): The values for the new index. axis : %(axes_single_arg)s, default 0 - The axis to update. The value 0 identifies the rows%(axis_description_sub)s. + The axis to update. The value 0 identifies the rows. For `Series` + this parameter is unused and defaults to 0. inplace : bool, default False Whether to return a new %(klass)s instance. @@ -6353,7 +6354,8 @@ def fillna( pad / ffill: propagate last valid observation forward to next valid backfill / bfill: use next valid observation to fill gap. axis : {axes_single_arg} - Axis along which to fill missing values. + Axis along which to fill missing values. For `Series` + this parameter is unused and defaults to 0. inplace : bool, default False If True, fill in-place. Note: this will modify any other views on this object (e.g., a no-copy slice for a column in a @@ -6829,7 +6831,8 @@ def interpolate( scipy 0.18. axis : {{0 or 'index', 1 or 'columns', None}}, default None - Axis to interpolate along. + Axis to interpolate along. For `Series` this parameter is unused + and defaults to 0. limit : int, optional Maximum number of consecutive NaNs to fill. Must be greater than 0. @@ -7476,8 +7479,9 @@ def clip( Maximum threshold value. All values above this threshold will be set to it. A missing threshold (e.g `NA`) will not clip the value. - axis : int or str axis name, optional + axis : {{0 or 'index', 1 or 'columns', None}}, default None Align object with lower and upper along the given axis. + For `Series` this parameter is unused and defaults to 0. inplace : bool, default False Whether to perform the operation in place on the data. *args, **kwargs @@ -7950,8 +7954,8 @@ def resample( rule : DateOffset, Timedelta or str The offset string or object representing target conversion. axis : {{0 or 'index', 1 or 'columns'}}, default 0 - Which axis to use for up- or down-sampling. For `Series` this - will default to 0, i.e. along the rows. Must be + Which axis to use for up- or down-sampling. For `Series` this parameter + is unused and defaults to 0. Must be `DatetimeIndex`, `TimedeltaIndex` or `PeriodIndex`. closed : {{'right', 'left'}}, default None Which side of bin interval is closed. The default is 'left' @@ -9257,7 +9261,8 @@ def where( inplace : bool, default False Whether to perform the operation in place on the data. axis : int, default None - Alignment axis if needed. + Alignment axis if needed. For `Series` this parameter is + unused and defaults to 0. level : int, default None Alignment level if needed. errors : str, {{'raise', 'ignore'}}, default 'raise' @@ -9442,7 +9447,7 @@ def shift( the freq or inferred_freq attributes of the index. If neither of those attributes exist, a ValueError is thrown. axis : {{0 or 'index', 1 or 'columns', None}}, default None - Shift direction. + Shift direction. For `Series` this parameter is unused and defaults to 0. fill_value : object, optional The scalar value to use for newly introduced missing values. the default depends on the dtype of `self`. @@ -9668,7 +9673,8 @@ def truncate( after : date, str, int Truncate all rows after this index value. axis : {0 or 'index', 1 or 'columns'}, optional - Axis to truncate. Truncates the index (rows) by default. + Axis to truncate. Truncates the index (rows) by default. + For `Series` this parameter is unused and defaults to 0. copy : bool, default is True, Return a copy of the truncated section. @@ -11670,7 +11676,8 @@ def _doc_params(cls): Parameters ---------- axis : {{0 or 'index', 1 or 'columns', None}}, default 0 - Indicate which axis or axes should be reduced. + Indicate which axis or axes should be reduced. For `Series` this parameter + is unused and defaults to 0. * 0 / 'index' : reduce the index, return a Series whose index is the original column labels. diff --git a/pandas/core/series.py b/pandas/core/series.py index b740bac78b263..3991dcfb9e7f6 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -169,9 +169,8 @@ _shared_doc_kwargs = { "axes": "index", "klass": "Series", - "axes_single_arg": "{0 or 'index'}", "axis": """axis : {0 or 'index'} - Parameter needed for compatibility with DataFrame.""", + Unused. Parameter needed for compatibility with DataFrame.""", "inplace": """inplace : bool, default False If True, performs operation inplace and returns None.""", "unique": "np.ndarray", @@ -1322,8 +1321,7 @@ def repeat(self, repeats, axis=None) -> Series: non-negative integer. Repeating 0 times will return an empty Series. axis : None - Must be ``None``. Has no effect but is accepted for compatibility - with numpy. + Unused. Parameter needed for compatibility with DataFrame. Returns ------- @@ -2311,9 +2309,8 @@ def idxmin(self, axis=0, skipna=True, *args, **kwargs): Parameters ---------- - axis : int, default 0 - For compatibility with DataFrame.idxmin. Redundant for application - on Series. + axis : {0 or 'index'} + Unused. Parameter needed for compatibility with DataFrame. skipna : bool, default True Exclude NA/null values. If the entire Series is NA, the result will be NA. @@ -2380,9 +2377,8 @@ def idxmax(self, axis=0, skipna=True, *args, **kwargs): Parameters ---------- - axis : int, default 0 - For compatibility with DataFrame.idxmax. Redundant for application - on Series. + axis : {0 or 'index'} + Unused. Parameter needed for compatibility with DataFrame. skipna : bool, default True Exclude NA/null values. If the entire Series is NA, the result will be NA. @@ -3389,9 +3385,8 @@ def sort_values( Parameters ---------- - axis : {0 or 'index'}, default 0 - Axis to direct sorting. The value 'index' is accepted for - compatibility with DataFrame.sort_values. + axis : {0 or 'index'} + Unused. Parameter needed for compatibility with DataFrame. ascending : bool or list of bools, default True If True, sort values in ascending order, otherwise descending. inplace : bool, default False @@ -3650,8 +3645,8 @@ def sort_index( # type: ignore[override] Parameters ---------- - axis : int, default 0 - Axis to direct sorting. This can only be 0 for Series. + axis : {0 or 'index'} + Parameter needed for compatibility with DataFrame. level : int, optional If not None, sort on values in specified index level(s). ascending : bool or list-like of bools, default True @@ -3798,8 +3793,8 @@ def argsort(self, axis=0, kind="quicksort", order=None) -> Series: Parameters ---------- - axis : {0 or "index"} - Has no effect but is accepted for compatibility with numpy. + axis : {0 or 'index'} + Unused. Parameter needed for compatibility with DataFrame. kind : {'mergesort', 'quicksort', 'heapsort', 'stable'}, default 'quicksort' Choice of sorting algorithm. See :func:`numpy.sort` for more information. 'mergesort' and 'stable' are the only stable algorithms. @@ -4626,7 +4621,6 @@ def _needs_reindex_multi(self, axes, method, level) -> bool: @doc( NDFrame.align, # type: ignore[has-type] klass=_shared_doc_kwargs["klass"], - axes_single_arg=_shared_doc_kwargs["axes_single_arg"], ) def align( self, @@ -4716,8 +4710,8 @@ def rename( Parameters ---------- - axis : {0 or "index"} - Unused. Accepted for compatibility with DataFrame method only. + axis : {0 or 'index'} + Unused. Parameter needed for compatibility with DataFrame. index : scalar, hashable sequence, dict-like or function, optional Functions or dict-like are transformations to apply to the index. @@ -4914,8 +4908,8 @@ def drop( # type: ignore[override] ---------- labels : single label or list-like Index labels to drop. - axis : 0, default 0 - Redundant for application on Series. + axis : {0 or 'index'} + Unused. Parameter needed for compatibility with DataFrame. index : single label or list-like Redundant for application on Series, but 'index' can be used instead of 'labels'. @@ -5529,8 +5523,8 @@ def dropna(self, axis=0, inplace=False, how=None): Parameters ---------- - axis : {0 or 'index'}, default 0 - There is only one axis to drop values from. + axis : {0 or 'index'} + Unused. Parameter needed for compatibility with DataFrame. inplace : bool, default False If True, do operation inplace and return None. how : str, optional From 969d456bb312b7ecabd42f1ee163cf39cd7c4fdd Mon Sep 17 00:00:00 2001 From: jackgoldsmith4 Date: Tue, 24 May 2022 21:48:31 -0400 Subject: [PATCH 02/11] fix trailing whitespace --- pandas/core/generic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 510aaf39a32e1..e88c0953263dd 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6831,7 +6831,7 @@ def interpolate( scipy 0.18. axis : {{0 or 'index', 1 or 'columns', None}}, default None - Axis to interpolate along. For `Series` this parameter is unused + Axis to interpolate along. For `Series` this parameter is unused and defaults to 0. limit : int, optional Maximum number of consecutive NaNs to fill. Must be greater than @@ -9261,7 +9261,7 @@ def where( inplace : bool, default False Whether to perform the operation in place on the data. axis : int, default None - Alignment axis if needed. For `Series` this parameter is + Alignment axis if needed. For `Series` this parameter is unused and defaults to 0. level : int, default None Alignment level if needed. @@ -9673,7 +9673,7 @@ def truncate( after : date, str, int Truncate all rows after this index value. axis : {0 or 'index', 1 or 'columns'}, optional - Axis to truncate. Truncates the index (rows) by default. + Axis to truncate. Truncates the index (rows) by default. For `Series` this parameter is unused and defaults to 0. copy : bool, default is True, Return a copy of the truncated section. From 5550f3c95032324732569d78c2c252cf386b2f92 Mon Sep 17 00:00:00 2001 From: jackgoldsmith4 Date: Tue, 24 May 2022 22:02:19 -0400 Subject: [PATCH 03/11] fix docs build --- pandas/core/series.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandas/core/series.py b/pandas/core/series.py index 3991dcfb9e7f6..1a76d91da9e05 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -169,6 +169,7 @@ _shared_doc_kwargs = { "axes": "index", "klass": "Series", + "axes_single_arg": "{0 or 'index'}", "axis": """axis : {0 or 'index'} Unused. Parameter needed for compatibility with DataFrame.""", "inplace": """inplace : bool, default False @@ -4621,6 +4622,7 @@ def _needs_reindex_multi(self, axes, method, level) -> bool: @doc( NDFrame.align, # type: ignore[has-type] klass=_shared_doc_kwargs["klass"], + axes_single_arg=_shared_doc_kwargs["axes_single_arg"], ) def align( self, From c5a8b41e18d8cf4d8d8d1020963e32ac6084a2e2 Mon Sep 17 00:00:00 2001 From: jackgoldsmith4 Date: Tue, 24 May 2022 22:14:41 -0400 Subject: [PATCH 04/11] add unused --- pandas/core/series.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 1a76d91da9e05..98bc3493935b0 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -3647,7 +3647,7 @@ def sort_index( # type: ignore[override] Parameters ---------- axis : {0 or 'index'} - Parameter needed for compatibility with DataFrame. + Unused. Parameter needed for compatibility with DataFrame. level : int, optional If not None, sort on values in specified index level(s). ascending : bool or list-like of bools, default True From 1582bd987da281281a7379e6f6d994cf3a182d55 Mon Sep 17 00:00:00 2001 From: jackgoldsmith4 Date: Thu, 26 May 2022 12:13:50 -0400 Subject: [PATCH 05/11] add or update docs for all series methods --- pandas/core/arrays/datetimes.py | 1 + pandas/core/base.py | 2 +- pandas/core/generic.py | 22 +++++++++++++++++----- pandas/core/ops/docstrings.py | 4 +++- pandas/core/shared_docs.py | 3 ++- pandas/core/window/ewm.py | 2 ++ pandas/core/window/expanding.py | 2 ++ pandas/core/window/rolling.py | 2 ++ 8 files changed, 30 insertions(+), 8 deletions(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index 63a3165b65e10..58cabf68dfd51 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -2004,6 +2004,7 @@ def std( ---------- axis : int optional, default None Axis for the function to be applied on. + For `Series` this parameter is unused and defaults to None. ddof : int, default 1 Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. diff --git a/pandas/core/base.py b/pandas/core/base.py index 38cf41a626deb..df850e4a90106 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -599,7 +599,7 @@ def argmax(self, axis=None, skipna: bool = True, *args, **kwargs) -> int: Parameters ---------- axis : {{None}} - Dummy argument for consistency with Series. + Unused. Parameter needed for compatibility with DataFrame. skipna : bool, default True Exclude NA/null values when showing the result. *args, **kwargs diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e88c0953263dd..a1b41d77670eb 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -808,6 +808,8 @@ def droplevel(self: NDFrameT, level, axis=0) -> NDFrameT: * 0 or 'index': remove level(s) in column. * 1 or 'columns': remove level(s) in row. + For `Series` this parameter is unused and defaults to 0. + Returns ------- {klass} @@ -876,7 +878,7 @@ def squeeze(self, axis=None): ---------- axis : {0 or 'index', 1 or 'columns', None}, default None A specific axis to squeeze. By default, all length-1 axes are - squeezed. + squeezed. For `Series` this parameter is unused and defaults to None. Returns ------- @@ -1064,7 +1066,7 @@ def rename_axis(self, mapper=lib.no_default, **kwargs): specify the axis to target with ``mapper``, or ``index`` and/or ``columns``. axis : {0 or 'index', 1 or 'columns'}, default 0 - The axis to rename. + The axis to rename. For `Series` this parameter is unused and defaults to 0. copy : bool, default True Also copy underlying data. inplace : bool, default False @@ -3542,6 +3544,7 @@ def take( axis : {0 or 'index', 1 or 'columns', None}, default 0 The axis on which to select elements. ``0`` means that we are selecting rows, ``1`` means that we are selecting columns. + For `Series` this parameter is unused and defaults to None. is_copy : bool Before pandas 1.0, ``is_copy=False`` can be specified to ensure that the return value is an actual copy. Starting with pandas 1.0, @@ -5087,8 +5090,8 @@ def filter( Keep labels from axis for which re.search(regex, label) == True. 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, - 'index' for Series, 'columns' for DataFrame. + or axis name (str). By default this is the info axis, 'columns' for DataFrame. + For `Series` this parameter is unused and defaults to None. Returns ------- @@ -5372,7 +5375,7 @@ def sample( axis : {0 or ‘index’, 1 or ‘columns’, None}, default None Axis to sample. Accepts axis number or name. Default is stat axis - for given data type (0 for Series and DataFrames). + for given data type. For `Series` this parameter is unused and defaults to None. ignore_index : bool, default False If True, the resulting index will be labeled 0, 1, …, n - 1. @@ -7747,6 +7750,7 @@ def at_time(self: NDFrameT, time, asof: bool_t = False, axis=None) -> NDFrameT: ---------- time : datetime.time or str axis : {0 or 'index', 1 or 'columns'}, default 0 + For `Series` this parameter is unused and defaults to 0. Returns ------- @@ -7833,6 +7837,7 @@ def between_time( Include boundaries; whether to set each bound as closed or open. axis : {0 or 'index', 1 or 'columns'}, default 0 Determine range time on index or columns value. + For `Series` this parameter is unused and defaults to 0. Returns ------- @@ -8524,6 +8529,7 @@ def rank( ---------- axis : {0 or 'index', 1 or 'columns'}, default 0 Index to direct ranking. + For `Series` this parameter is unused and defaults to 0. method : {'average', 'min', 'max', 'first', 'dense'}, default 'average' How to rank the group of records that have the same value (i.e. ties): @@ -9581,6 +9587,8 @@ def slice_shift(self: NDFrameT, periods: int = 1, axis=0) -> NDFrameT: ---------- periods : int Number of periods to move, can be positive or negative. + axis : {0 or 'index', 1 or 'columns', None}, default 0 + For `Series` this parameter is unused and defaults to 0. Returns ------- @@ -9632,6 +9640,7 @@ def tshift(self: NDFrameT, periods: int = 1, freq=None, axis: Axis = 0) -> NDFra or time rule expressed as a string (e.g. 'EOM'). axis : {0 or ‘index’, 1 or ‘columns’, None}, default 0 Corresponds to the axis that contains the Index. + For `Series` this parameter is unused and defaults to 0. Returns ------- @@ -10897,6 +10906,7 @@ def mad( ---------- axis : {axis_descr} Axis for the function to be applied on. + For `Series` this parameter is unused and defaults to 0. skipna : bool, default True Exclude NA/null values when computing the result. level : int or level name, default None @@ -11555,6 +11565,7 @@ def _doc_params(cls): ---------- axis : {axis_descr} Axis for the function to be applied on. + For `Series` this parameter is unused and defaults to 0. skipna : bool, default True Exclude NA/null values when computing the result. level : int or level name, default None @@ -11779,6 +11790,7 @@ def _doc_params(cls): ---------- axis : {{0 or 'index', 1 or 'columns'}}, default 0 The index or the name of the axis. 0 is equivalent to None or 'index'. + For `Series` this parameter is unused and defaults to 0. skipna : bool, default True Exclude NA/null values. If an entire row/column is NA, the result will be NA. diff --git a/pandas/core/ops/docstrings.py b/pandas/core/ops/docstrings.py index 9134ec7a73bea..eefd2e7a7927a 100644 --- a/pandas/core/ops/docstrings.py +++ b/pandas/core/ops/docstrings.py @@ -428,6 +428,8 @@ def make_flex_doc(op_name: str, typ: str) -> str: Parameters ---------- other : Series or scalar value +axis : {{0 or 'index'}} + Unused. Parameter needed for compatibility with DataFrame. fill_value : None or float value, default None (NaN) Fill existing missing (NaN) values, and any new element needed for successful Series alignment, with this value before computation. @@ -462,7 +464,7 @@ def make_flex_doc(op_name: str, typ: str) -> str: other : scalar, sequence, Series, or DataFrame Any single or multiple element data structure, or list-like object. axis : {{0 or 'index', 1 or 'columns'}} - Whether to compare by the index (0 or 'index') or columns + Whether to compare by the index (0 or 'index') or columns. (1 or 'columns'). For Series input, axis to match Series index on. level : int or label Broadcast across a level, matching Index values on the diff --git a/pandas/core/shared_docs.py b/pandas/core/shared_docs.py index 79d79c7037992..3750a8a3ceed9 100644 --- a/pandas/core/shared_docs.py +++ b/pandas/core/shared_docs.py @@ -101,7 +101,8 @@ of labels may be passed to group by the columns in ``self``. Notice that a tuple is interpreted as a (single) key. axis : {0 or 'index', 1 or 'columns'}, default 0 - Split along rows (0) or columns (1). + Split along rows (0) or columns (1). For `Series` this parameter + is unused and defaults to 0. level : int, level name, or sequence of such, default None If the axis is a MultiIndex (hierarchical), group by a particular level or levels. diff --git a/pandas/core/window/ewm.py b/pandas/core/window/ewm.py index 922d194f04c55..d2b4db75f839b 100644 --- a/pandas/core/window/ewm.py +++ b/pandas/core/window/ewm.py @@ -211,6 +211,8 @@ class ExponentialMovingWindow(BaseWindow): If ``1`` or ``'columns'``, calculate across the columns. + For `Series` this parameter is unused and defaults to 0. + times : str, np.ndarray, Series, default None .. versionadded:: 1.1.0 diff --git a/pandas/core/window/expanding.py b/pandas/core/window/expanding.py index 7c1b0d86ddf27..36a1da0dbf837 100644 --- a/pandas/core/window/expanding.py +++ b/pandas/core/window/expanding.py @@ -64,6 +64,8 @@ class Expanding(RollingAndExpandingMixin): If ``1`` or ``'columns'``, roll across the columns. + For `Series` this parameter is unused and defaults to 0. + method : str {'single', 'table'}, default 'single' Execute the rolling operation per single column or row (``'single'``) or over the entire object (``'table'``). diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index ad6f0863449b6..9e8f95cf340c4 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -922,6 +922,8 @@ class Window(BaseWindow): If ``1`` or ``'columns'``, roll across the columns. + For `Series` this parameter is unused and defaults to 0. + closed : str, default None If ``'right'``, the first point in the window is excluded from calculations. From 72f8f8c6c6fd3d8806579cb54fa4fbe311f05032 Mon Sep 17 00:00:00 2001 From: jackgoldsmith4 Date: Thu, 26 May 2022 12:16:58 -0400 Subject: [PATCH 06/11] small fix --- pandas/core/generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index a1b41d77670eb..e2c7b3431f125 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3544,7 +3544,7 @@ def take( axis : {0 or 'index', 1 or 'columns', None}, default 0 The axis on which to select elements. ``0`` means that we are selecting rows, ``1`` means that we are selecting columns. - For `Series` this parameter is unused and defaults to None. + For `Series` this parameter is unused and defaults to 0. is_copy : bool Before pandas 1.0, ``is_copy=False`` can be specified to ensure that the return value is an actual copy. Starting with pandas 1.0, @@ -7484,7 +7484,7 @@ def clip( threshold (e.g `NA`) will not clip the value. axis : {{0 or 'index', 1 or 'columns', None}}, default None Align object with lower and upper along the given axis. - For `Series` this parameter is unused and defaults to 0. + For `Series` this parameter is unused and defaults to None. inplace : bool, default False Whether to perform the operation in place on the data. *args, **kwargs From 054c641bb35d75367ba15e1bcaf01c6e36111556 Mon Sep 17 00:00:00 2001 From: jackgoldsmith4 Date: Thu, 26 May 2022 12:18:23 -0400 Subject: [PATCH 07/11] fix line length --- pandas/core/generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e2c7b3431f125..c1c70645ae922 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5090,8 +5090,8 @@ def filter( Keep labels from axis for which re.search(regex, label) == True. 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. + or axis name (str). By default this is the info axis, 'columns' for + DataFrame.For `Series` this parameter is unused and defaults to None. Returns ------- From 03a0b3381c5b9f5bcd61932686e416164c5898e3 Mon Sep 17 00:00:00 2001 From: jackgoldsmith4 Date: Thu, 26 May 2022 12:42:19 -0400 Subject: [PATCH 08/11] fix param order --- pandas/core/ops/docstrings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/ops/docstrings.py b/pandas/core/ops/docstrings.py index eefd2e7a7927a..e1ee99122bc35 100644 --- a/pandas/core/ops/docstrings.py +++ b/pandas/core/ops/docstrings.py @@ -428,8 +428,6 @@ def make_flex_doc(op_name: str, typ: str) -> str: Parameters ---------- other : Series or scalar value -axis : {{0 or 'index'}} - Unused. Parameter needed for compatibility with DataFrame. fill_value : None or float value, default None (NaN) Fill existing missing (NaN) values, and any new element needed for successful Series alignment, with this value before computation. @@ -438,6 +436,8 @@ def make_flex_doc(op_name: str, typ: str) -> str: level : int or name Broadcast across a level, matching Index values on the passed MultiIndex level. +axis : {{0 or 'index'}} + Unused. Parameter needed for compatibility with DataFrame. Returns ------- From 2cf6d8cc304d14de53046fa4ba049ed0d281bb1b Mon Sep 17 00:00:00 2001 From: jackgoldsmith4 Date: Thu, 26 May 2022 13:21:01 -0400 Subject: [PATCH 09/11] fix param order --- pandas/core/ops/docstrings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/ops/docstrings.py b/pandas/core/ops/docstrings.py index e1ee99122bc35..aa469c2e07726 100644 --- a/pandas/core/ops/docstrings.py +++ b/pandas/core/ops/docstrings.py @@ -428,14 +428,14 @@ def make_flex_doc(op_name: str, typ: str) -> str: Parameters ---------- other : Series or scalar value +level : int or name + Broadcast across a level, matching Index values on the + passed MultiIndex level. fill_value : None or float value, default None (NaN) Fill existing missing (NaN) values, and any new element needed for successful Series alignment, with this value before computation. If data in both corresponding Series locations is missing the result of filling (at that location) will be missing. -level : int or name - Broadcast across a level, matching Index values on the - passed MultiIndex level. axis : {{0 or 'index'}} Unused. Parameter needed for compatibility with DataFrame. From f62a1b4f83b21eafe5e6f289c8fd19f829a05c9c Mon Sep 17 00:00:00 2001 From: jackgoldsmith4 Date: Fri, 27 May 2022 00:53:27 -0400 Subject: [PATCH 10/11] add --- pandas/core/generic.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index c1c70645ae922..68c077a199ed4 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11596,6 +11596,7 @@ def _doc_params(cls): Parameters ---------- axis : {axis_descr} + For `Series` this parameter is unused and defaults to 0. skipna : bool, default True Exclude NA/null values. If an entire row/column is NA, the result will be NA. From 95cedca0679ccffc2a22a635d301df32c89825d7 Mon Sep 17 00:00:00 2001 From: jackgoldsmith4 Date: Fri, 27 May 2022 09:12:01 -0400 Subject: [PATCH 11/11] add backticks to None and fix space --- pandas/core/arrays/datetimes.py | 2 +- pandas/core/generic.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index 58cabf68dfd51..9ae3eecd9b1ca 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -2004,7 +2004,7 @@ def std( ---------- axis : int optional, default None Axis for the function to be applied on. - For `Series` this parameter is unused and defaults to None. + For `Series` this parameter is unused and defaults to `None`. ddof : int, default 1 Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 68c077a199ed4..70e1f555d15c8 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -878,7 +878,7 @@ def squeeze(self, axis=None): ---------- axis : {0 or 'index', 1 or 'columns', None}, default None A specific axis to squeeze. By default, all length-1 axes are - squeezed. For `Series` this parameter is unused and defaults to None. + squeezed. For `Series` this parameter is unused and defaults to `None`. Returns ------- @@ -5091,7 +5091,7 @@ 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 ------- @@ -5375,7 +5375,7 @@ def sample( axis : {0 or ‘index’, 1 or ‘columns’, None}, default None Axis to sample. Accepts axis number or name. Default is stat axis - for given data type. For `Series` this parameter is unused and defaults to None. + for given data type. For `Series` this parameter is unused and defaults to `None`. ignore_index : bool, default False If True, the resulting index will be labeled 0, 1, …, n - 1. @@ -7484,7 +7484,7 @@ def clip( threshold (e.g `NA`) will not clip the value. axis : {{0 or 'index', 1 or 'columns', None}}, default None Align object with lower and upper along the given axis. - For `Series` this parameter is unused and defaults to None. + For `Series` this parameter is unused and defaults to `None`. inplace : bool, default False Whether to perform the operation in place on the data. *args, **kwargs