From 6bffc95dd6d06b4b64f378c2cfdb5562bd17cc16 Mon Sep 17 00:00:00 2001 From: Nagesh Kumar C Date: Sun, 18 Oct 2020 18:36:03 +0530 Subject: [PATCH 1/8] DOC: Updated resample.py and groupby.py to fix SA04 Errors --- pandas/core/groupby/groupby.py | 4 ++-- pandas/core/resample.py | 23 +++++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 3938adce6736a..3749ee26820dd 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -79,8 +79,8 @@ class providing the base-class of operations. _common_see_also = """ See Also -------- - Series.%(name)s - DataFrame.%(name)s + Series.%(name)s : Apply a function %(name)s to a Series. + DataFrame.%(name)s : Apply a function %(name)s to each row or column of a DataFrame. """ _apply_docs = dict( diff --git a/pandas/core/resample.py b/pandas/core/resample.py index 3f1b1dac080a7..913dc7478718e 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -131,7 +131,7 @@ def __iter__(self): See Also -------- - GroupBy.__iter__ + GroupBy.__iter__ : Generator yielding sequence of (name, subset object) for each group """ self._set_binner() return super().__iter__() @@ -235,9 +235,9 @@ def pipe(self, func, *args, **kwargs): """ See Also -------- - DataFrame.groupby.aggregate - DataFrame.resample.transform - DataFrame.aggregate + DataFrame.groupby.aggregate : Aggregate using callable, string, dict, or list of string/callables + DataFrame.resample.transform : Transforms the Series on each group based on the given function. + DataFrame.aggregate: Aggregate using one or more operations over the specified axis. """ ) @@ -453,8 +453,8 @@ def pad(self, limit=None): See Also -------- - Series.fillna - DataFrame.fillna + Series.fillna: Fill NA/NaN values using the specified method. + DataFrame.fillna: Fill NA/NaN values using the specified method. """ return self._upsample("pad", limit=limit) @@ -828,8 +828,8 @@ def asfreq(self, fill_value=None): See Also -------- - Series.asfreq - DataFrame.asfreq + Series.asfreq: Convert TimeSeries to specified frequency. + DataFrame.asfreq: Convert TimeSeries to specified frequency. """ return self._upsample("asfreq", fill_value=fill_value) @@ -915,8 +915,11 @@ def quantile(self, q=0.5, **kwargs): See Also -------- Series.quantile + Return a series, where the index is q and the values are the quantiles DataFrame.quantile + Return a DataFrame, where the columns are the columns of self, and the values are the quantiles. DataFrameGroupBy.quantile + Return a DataFrame, where the coulmns are groupby columns, and the values are its quantiles. """ return self._downsample("quantile", q=q, **kwargs) @@ -1072,7 +1075,7 @@ def _upsample(self, method, limit=None, fill_value=None): See Also -------- - .fillna + .fillna: Fill NA/NaN values using the specified method. """ self._set_binner() @@ -1208,7 +1211,7 @@ def _upsample(self, method, limit=None, fill_value=None): See Also -------- - .fillna + .fillna: Fill NA/NaN values using the specified method. """ # we may need to actually resample as if we are timestamps From 4e51abf1edf33806f490dd84ca3bf0f8756a3540 Mon Sep 17 00:00:00 2001 From: Nagesh Kumar C Date: Sun, 18 Oct 2020 18:57:54 +0530 Subject: [PATCH 2/8] DOC: Fixed flake8 issue --- pandas/core/groupby/groupby.py | 3 ++- pandas/core/resample.py | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 3749ee26820dd..2b154717d0bc9 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -80,7 +80,8 @@ class providing the base-class of operations. See Also -------- Series.%(name)s : Apply a function %(name)s to a Series. - DataFrame.%(name)s : Apply a function %(name)s to each row or column of a DataFrame. + DataFrame.%(name)s : Apply a function %(name)s + to each row or column of a DataFrame. """ _apply_docs = dict( diff --git a/pandas/core/resample.py b/pandas/core/resample.py index 913dc7478718e..0488fc11ccd20 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -131,7 +131,7 @@ def __iter__(self): See Also -------- - GroupBy.__iter__ : Generator yielding sequence of (name, subset object) for each group + GroupBy.__iter__ : Generator yielding sequence for each group. """ self._set_binner() return super().__iter__() @@ -235,9 +235,12 @@ def pipe(self, func, *args, **kwargs): """ See Also -------- - DataFrame.groupby.aggregate : Aggregate using callable, string, dict, or list of string/callables - DataFrame.resample.transform : Transforms the Series on each group based on the given function. - DataFrame.aggregate: Aggregate using one or more operations over the specified axis. + DataFrame.groupby.aggregate : Aggregate using callable, string, dict, + or list of string/callables. + DataFrame.resample.transform : Transforms the Series on each group + based on the given function. + DataFrame.aggregate: Aggregate using one or more + operations over the specified axis. """ ) @@ -915,11 +918,13 @@ def quantile(self, q=0.5, **kwargs): See Also -------- Series.quantile - Return a series, where the index is q and the values are the quantiles + Return a series, where the index is q and the values are the quantiles. DataFrame.quantile - Return a DataFrame, where the columns are the columns of self, and the values are the quantiles. + Return a DataFrame, where the columns are the columns of self, + and the values are the quantiles. DataFrameGroupBy.quantile - Return a DataFrame, where the coulmns are groupby columns, and the values are its quantiles. + Return a DataFrame, where the coulmns are groupby columns, + and the values are its quantiles. """ return self._downsample("quantile", q=q, **kwargs) From 891c5ea0acb0cc233c0b20acadf7351ef24528a4 Mon Sep 17 00:00:00 2001 From: Nagesh Kumar C Date: Tue, 20 Oct 2020 00:35:10 +0530 Subject: [PATCH 3/8] #28792 DOC: Fixed SA04 Errors --- pandas/_libs/tslibs/timedeltas.pyx | 3 ++- pandas/core/arrays/base.py | 10 ++++---- pandas/core/arrays/boolean.py | 2 +- pandas/core/arrays/categorical.py | 2 +- pandas/core/arrays/integer.py | 2 +- pandas/core/dtypes/base.py | 5 ++-- pandas/core/frame.py | 2 +- pandas/core/generic.py | 6 ++--- pandas/core/groupby/groupby.py | 38 +++++++++++++++++------------- pandas/core/indexes/accessors.py | 3 ++- pandas/core/indexes/base.py | 12 ++++++---- pandas/io/formats/style.py | 9 +++---- 12 files changed, 53 insertions(+), 41 deletions(-) diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index c6b47d09cf0bd..96d9807d10921 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1056,7 +1056,8 @@ cdef class _Timedelta(timedelta): See Also -------- - Timestamp.isoformat + Timestamp.isoformat : function is used to convert the given + Timestamp object into the ISO format. Notes ----- diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index debfb50caeeaa..408f8b04c1c4d 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -232,8 +232,8 @@ def _from_factorized(cls, values, original): See Also -------- - factorize - ExtensionArray.factorize + factorize : Top-level factorize method that dispatches here. + ExtensionArray.factorize : Encode the extension array as an enumerated type. """ raise AbstractMethodError(cls) @@ -501,7 +501,7 @@ def _values_for_argsort(self) -> np.ndarray: See Also -------- - ExtensionArray.argsort + ExtensionArray.argsort : Return the indices that would sort this array. """ # Note: this is used in `ExtensionArray.argsort`. return np.array(self) @@ -956,8 +956,8 @@ def take( See Also -------- - numpy.take - api.extensions.take + numpy.take : Take elements from an array along an axis. + api.extensions.take : Take elements from an array. Notes ----- diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index 9ffe00cf3189a..de2da3f2845e7 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -418,7 +418,7 @@ def _values_for_argsort(self) -> np.ndarray: See Also -------- - ExtensionArray.argsort + ExtensionArray.argsort: Return the indices that would sort this array. """ data = self._data.copy() data[self._mask] = -1 diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 081a363ce03c6..1b6a428d7df0d 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -2061,7 +2061,7 @@ def unique(self): -------- pandas.unique CategoricalIndex.unique - Series.unique + Series.unique : Return unique values of Series object. Examples -------- diff --git a/pandas/core/arrays/integer.py b/pandas/core/arrays/integer.py index 88a5a88efe146..2d0e0bfbf3a1a 100644 --- a/pandas/core/arrays/integer.py +++ b/pandas/core/arrays/integer.py @@ -484,7 +484,7 @@ def _values_for_argsort(self) -> np.ndarray: See Also -------- - ExtensionArray.argsort + ExtensionArray.argsort: Return the indices that would sort this array. """ data = self._data.copy() if self._mask.any(): diff --git a/pandas/core/dtypes/base.py b/pandas/core/dtypes/base.py index 96de54380c7ad..36bf4a5181d82 100644 --- a/pandas/core/dtypes/base.py +++ b/pandas/core/dtypes/base.py @@ -21,8 +21,9 @@ class ExtensionDtype: See Also -------- - extensions.register_extension_dtype - extensions.ExtensionArray + extensions.register_extension_dtype: Register an ExtensionType + with pandas as class decorator. + extensions.ExtensionArray: Abstract base class for custom 1-D array types. Notes ----- diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 801307a8f9481..098b65274e03b 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -586,7 +586,7 @@ def shape(self) -> Tuple[int, int]: See Also -------- - ndarray.shape + ndarray.shape : Tuple of array dimensions. Examples -------- diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 6991ed655aec8..45664ca9bcc11 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -257,7 +257,7 @@ def attrs(self) -> Dict[Optional[Hashable], Any]: See Also -------- - DataFrame.flags + DataFrame.flags : Global flags applying to this object. """ if self._attrs is None: self._attrs = {} @@ -278,8 +278,8 @@ def flags(self) -> Flags: See Also -------- - Flags - DataFrame.attrs + Flags : Flags that apply to pandas objects. + DataFrame.attrs : Global metadata applying to this dataset. Notes ----- diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 2b154717d0bc9..9bc8d391ac8b8 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -319,9 +319,12 @@ class providing the base-class of operations. See Also -------- -%(klass)s.groupby.apply -%(klass)s.groupby.aggregate -%(klass)s.transform +%(klass)s.groupby.apply : Apply function func group-wise + and combine the results together. +%(klass)s.groupby.aggregate : Aggregate using one or more + operations over the specified axis. +%(klass)s.transform : Transforms the Series on each group + based on the given function. Notes ----- @@ -428,9 +431,12 @@ class providing the base-class of operations. See Also -------- -{klass}.groupby.apply -{klass}.groupby.transform -{klass}.aggregate +{klass}.groupby.apply : Apply function func group-wise + and combine the results together. +{klass}.groupby.transform : Aggregate using one or more + operations over the specified axis. +{klass}.aggregate : Transforms the Series on each group + based on the given function. Notes ----- @@ -1857,8 +1863,8 @@ def _fill(self, direction, limit=None): See Also -------- - pad - backfill + pad : Returns Series with minimum number of char in object. + backfill : Backward fill the missing values in the dataset. """ # Need int value for Cython if limit is None: @@ -1892,10 +1898,10 @@ def pad(self, limit=None): See Also -------- - Series.pad - DataFrame.pad - Series.fillna - DataFrame.fillna + Series.pad: Returns Series with minimum number of char in object. + DataFrame.pad: Object with missing values filled or None if inplace=True. + Series.fillna: Fill NaN values of a Series. + DataFrame.fillna: Fill NaN values of a DataFrame. """ return self._fill("ffill", limit=limit) @@ -1918,10 +1924,10 @@ def backfill(self, limit=None): See Also -------- - Series.backfill - DataFrame.backfill - Series.fillna - DataFrame.fillna + Series.backfill : Backward fill the missing values in the dataset. + DataFrame.backfill: Backward fill the missing values in the dataset + Series.fillna: Fill NaN values of a Series. + DataFrame.fillna: Fill NaN values of a DataFrame. """ return self._fill("bfill", limit=limit) diff --git a/pandas/core/indexes/accessors.py b/pandas/core/indexes/accessors.py index b9b2c4b07d37a..0a735894291a0 100644 --- a/pandas/core/indexes/accessors.py +++ b/pandas/core/indexes/accessors.py @@ -326,7 +326,8 @@ def to_pytimedelta(self) -> np.ndarray: See Also -------- - datetime.timedelta + datetime.timedelta : A duration expressing the difference + between two date, time, or datetime. Examples -------- diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 2ebf2389823e9..b580abc30498e 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -609,7 +609,7 @@ def ravel(self, order="C"): See Also -------- - numpy.ndarray.ravel + numpy.ndarray.ravel : Return a flattened array. """ warnings.warn( "Index.ravel returning ndarray is deprecated; in a future version " @@ -705,7 +705,8 @@ def astype(self, dtype, copy=True): See Also -------- - numpy.ndarray.take + numpy.ndarray.take: Return an array formed from the + elements of a at the given indices. """ @Appender(_index_shared_docs["take"] % _index_doc_kwargs) @@ -2298,8 +2299,8 @@ def unique(self, level=None): See Also -------- - unique - Series.unique + unique : Numpy array of unique values in that column. + Series.unique : Return unique values of Series object. """ if level is not None: self._validate_index_level(level) @@ -4229,7 +4230,8 @@ def putmask(self, mask, value): See Also -------- - numpy.ndarray.putmask + numpy.ndarray.putmask : Changes elements of an array + based on conditional and input values. """ values = self.values.copy() try: diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 0089d7a32f723..91886cca7af5c 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -829,7 +829,8 @@ def applymap(self, func: Callable, subset=None, **kwargs) -> "Styler": See Also -------- - Styler.where + Styler.where: Updates the HTML representation with a style which is + selected in accordance with the return value of a function. """ self._todo.append( (lambda instance: getattr(instance, "_applymap"), (func, subset), kwargs) @@ -870,7 +871,7 @@ def where( See Also -------- - Styler.applymap + Styler.applymap: Updates the HTML representation with the result. """ if other is None: other = "" @@ -930,7 +931,7 @@ def export(self) -> List[Tuple[Callable, Tuple, Dict]]: See Also -------- - Styler.use + Styler.use: Set the styles on the current Styler. """ return self._todo @@ -951,7 +952,7 @@ def use(self, styles: List[Tuple[Callable, Tuple, Dict]]) -> "Styler": See Also -------- - Styler.export + Styler.export : Export the styles to applied to the current Styler. """ self._todo.extend(styles) return self From d060ab40ec11116522f6ceb707b86e76274ab5f7 Mon Sep 17 00:00:00 2001 From: Nagesh Kumar C Date: Tue, 20 Oct 2020 08:41:24 +0530 Subject: [PATCH 4/8] #28792 Doc Fix SA04 Errors --- pandas/_libs/tslibs/timedeltas.pyx | 2 +- pandas/core/groupby/groupby.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 96d9807d10921..23e8ca1163635 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1056,7 +1056,7 @@ cdef class _Timedelta(timedelta): See Also -------- - Timestamp.isoformat : function is used to convert the given + Timestamp.isoformat : Function is used to convert the given Timestamp object into the ISO format. Notes diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 9bc8d391ac8b8..74f7759ad4598 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -1925,7 +1925,7 @@ def backfill(self, limit=None): See Also -------- Series.backfill : Backward fill the missing values in the dataset. - DataFrame.backfill: Backward fill the missing values in the dataset + DataFrame.backfill: Backward fill the missing values in the dataset. Series.fillna: Fill NaN values of a Series. DataFrame.fillna: Fill NaN values of a DataFrame. """ From d21675a7b98058276f497a4998d6fb4c67db2f29 Mon Sep 17 00:00:00 2001 From: Nagesh Kumar C <65619177+nagesh-chowdaiah@users.noreply.github.com> Date: Wed, 21 Oct 2020 14:30:47 +0530 Subject: [PATCH 5/8] Update pandas/core/arrays/integer.py Co-authored-by: Joris Van den Bossche --- pandas/core/arrays/integer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/integer.py b/pandas/core/arrays/integer.py index 2d0e0bfbf3a1a..e53276369a46f 100644 --- a/pandas/core/arrays/integer.py +++ b/pandas/core/arrays/integer.py @@ -484,7 +484,7 @@ def _values_for_argsort(self) -> np.ndarray: See Also -------- - ExtensionArray.argsort: Return the indices that would sort this array. + ExtensionArray.argsort : Return the indices that would sort this array. """ data = self._data.copy() if self._mask.any(): From df28152248815cea8426224c0b4994841dda47cb Mon Sep 17 00:00:00 2001 From: Nagesh Kumar C <65619177+nagesh-chowdaiah@users.noreply.github.com> Date: Wed, 21 Oct 2020 14:31:03 +0530 Subject: [PATCH 6/8] Update pandas/core/arrays/boolean.py Co-authored-by: Joris Van den Bossche --- pandas/core/arrays/boolean.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index de2da3f2845e7..b46e70f5a936d 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -418,7 +418,7 @@ def _values_for_argsort(self) -> np.ndarray: See Also -------- - ExtensionArray.argsort: Return the indices that would sort this array. + ExtensionArray.argsort : Return the indices that would sort this array. """ data = self._data.copy() data[self._mask] = -1 From 4ca7957358829673f5c96e3b0a2ea0963b451282 Mon Sep 17 00:00:00 2001 From: Nagesh Kumar C Date: Wed, 21 Oct 2020 14:49:11 +0530 Subject: [PATCH 7/8] #28792 DOC: udpated reviewers comments --- pandas/_libs/tslibs/timedeltas.pyx | 2 +- pandas/core/arrays/datetimes.py | 6 ++++-- pandas/core/dtypes/base.py | 2 +- pandas/core/groupby/groupby.py | 14 +++++++------- pandas/core/indexes/accessors.py | 8 +++++--- pandas/core/indexes/base.py | 6 +++--- pandas/core/resample.py | 6 +++--- pandas/io/formats/style.py | 2 +- 8 files changed, 25 insertions(+), 21 deletions(-) diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 23e8ca1163635..e21526a8f69e4 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1057,7 +1057,7 @@ cdef class _Timedelta(timedelta): See Also -------- Timestamp.isoformat : Function is used to convert the given - Timestamp object into the ISO format. + Timestamp object into the ISO format. Notes ----- diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index b1b8b513320e9..52a10c96d5c21 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -1259,8 +1259,10 @@ def isocalendar(self): See Also -------- - Timestamp.isocalendar - datetime.date.isocalendar + Timestamp.isocalendar : Function return a 3-tuple containing ISO year, + week number, and weekday for the given Timestamp object. + datetime.date.isocalendar : Return a named tuple object with + three components: year, week and weekday. Examples -------- diff --git a/pandas/core/dtypes/base.py b/pandas/core/dtypes/base.py index 36bf4a5181d82..8630867c64f88 100644 --- a/pandas/core/dtypes/base.py +++ b/pandas/core/dtypes/base.py @@ -22,7 +22,7 @@ class ExtensionDtype: See Also -------- extensions.register_extension_dtype: Register an ExtensionType - with pandas as class decorator. + with pandas as class decorator. extensions.ExtensionArray: Abstract base class for custom 1-D array types. Notes diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 74f7759ad4598..dcd134d0b5da3 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -81,7 +81,7 @@ class providing the base-class of operations. -------- Series.%(name)s : Apply a function %(name)s to a Series. DataFrame.%(name)s : Apply a function %(name)s - to each row or column of a DataFrame. + to each row or column of a DataFrame. """ _apply_docs = dict( @@ -320,11 +320,11 @@ class providing the base-class of operations. See Also -------- %(klass)s.groupby.apply : Apply function func group-wise - and combine the results together. + and combine the results together. %(klass)s.groupby.aggregate : Aggregate using one or more - operations over the specified axis. + operations over the specified axis. %(klass)s.transform : Transforms the Series on each group - based on the given function. + based on the given function. Notes ----- @@ -432,11 +432,11 @@ class providing the base-class of operations. See Also -------- {klass}.groupby.apply : Apply function func group-wise - and combine the results together. + and combine the results together. {klass}.groupby.transform : Aggregate using one or more - operations over the specified axis. + operations over the specified axis. {klass}.aggregate : Transforms the Series on each group - based on the given function. + based on the given function. Notes ----- diff --git a/pandas/core/indexes/accessors.py b/pandas/core/indexes/accessors.py index 0a735894291a0..50c64b312d4e6 100644 --- a/pandas/core/indexes/accessors.py +++ b/pandas/core/indexes/accessors.py @@ -236,8 +236,10 @@ def isocalendar(self): See Also -------- - Timestamp.isocalendar - datetime.date.isocalendar + Timestamp.isocalendar : Function return a 3-tuple containing ISO year, week number, + and weekday for the given Timestamp object. + datetime.date.isocalendar : Return a named tuple object with + three components: year, week and weekday. Examples -------- @@ -327,7 +329,7 @@ def to_pytimedelta(self) -> np.ndarray: See Also -------- datetime.timedelta : A duration expressing the difference - between two date, time, or datetime. + between two date, time, or datetime. Examples -------- diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index b580abc30498e..3ae5ba7355a3d 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -706,7 +706,7 @@ def astype(self, dtype, copy=True): See Also -------- numpy.ndarray.take: Return an array formed from the - elements of a at the given indices. + elements of a at the given indices. """ @Appender(_index_shared_docs["take"] % _index_doc_kwargs) @@ -3939,7 +3939,7 @@ def _values(self) -> Union[ExtensionArray, np.ndarray]: See Also -------- - values + values : Values """ return self._data @@ -4231,7 +4231,7 @@ def putmask(self, mask, value): See Also -------- numpy.ndarray.putmask : Changes elements of an array - based on conditional and input values. + based on conditional and input values. """ values = self.values.copy() try: diff --git a/pandas/core/resample.py b/pandas/core/resample.py index 0488fc11ccd20..3aabd33f7b30c 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -236,11 +236,11 @@ def pipe(self, func, *args, **kwargs): See Also -------- DataFrame.groupby.aggregate : Aggregate using callable, string, dict, - or list of string/callables. + or list of string/callables. DataFrame.resample.transform : Transforms the Series on each group - based on the given function. + based on the given function. DataFrame.aggregate: Aggregate using one or more - operations over the specified axis. + operations over the specified axis. """ ) diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 91886cca7af5c..2f3416cbf2d87 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -830,7 +830,7 @@ def applymap(self, func: Callable, subset=None, **kwargs) -> "Styler": See Also -------- Styler.where: Updates the HTML representation with a style which is - selected in accordance with the return value of a function. + selected in accordance with the return value of a function. """ self._todo.append( (lambda instance: getattr(instance, "_applymap"), (func, subset), kwargs) From deae8af0747dabc22ce36c42a0ec1b5a77a2544c Mon Sep 17 00:00:00 2001 From: Nagesh Kumar C Date: Wed, 21 Oct 2020 15:00:46 +0530 Subject: [PATCH 8/8] #28792 DOC: Fixing flake8 Errors --- pandas/core/indexes/accessors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/indexes/accessors.py b/pandas/core/indexes/accessors.py index 50c64b312d4e6..3eb18d176dd92 100644 --- a/pandas/core/indexes/accessors.py +++ b/pandas/core/indexes/accessors.py @@ -236,8 +236,8 @@ def isocalendar(self): See Also -------- - Timestamp.isocalendar : Function return a 3-tuple containing ISO year, week number, - and weekday for the given Timestamp object. + Timestamp.isocalendar : Function return a 3-tuple containing ISO year, + week number, and weekday for the given Timestamp object. datetime.date.isocalendar : Return a named tuple object with three components: year, week and weekday.