From 32097bc8c738580ac3ac5291dc5614288030eff3 Mon Sep 17 00:00:00 2001 From: Adrian Mastronardi Date: Sat, 22 Feb 2020 12:37:15 -0300 Subject: [PATCH 1/8] DOC: Fix SA04 errors in doc. Fixed line too long error --- pandas/core/algorithms.py | 6 +++--- pandas/core/frame.py | 19 +++++++++++-------- pandas/core/series.py | 11 +++++++---- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 02a979aea6c6b..6cc47244ee76e 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -313,8 +313,8 @@ def unique(values): See Also -------- - Index.unique - Series.unique + Index.unique : Return Index with unique values from an Index object. + Series.unique : Return unique values of Series object. Examples -------- @@ -1515,7 +1515,7 @@ def take(arr, indices, axis: int = 0, allow_fill: bool = False, fill_value=None) See Also -------- - numpy.take + numpy.take : Take elements from an array along an axis. Examples -------- diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 9fe1ec7b792c8..b083c8e803fc3 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -358,9 +358,9 @@ class DataFrame(NDFrame): -------- DataFrame.from_records : Constructor from tuples, also record arrays. DataFrame.from_dict : From dicts of Series, arrays, or dicts. - read_csv - read_table - read_clipboard + read_csv : Read a comma-separated values (csv) file into DataFrame. + read_table : Read general delimited file into DataFrame. + read_clipboard : Read text from clipboard and pass to read_table. Examples -------- @@ -7292,8 +7292,9 @@ def corr(self, method="pearson", min_periods=1) -> "DataFrame": See Also -------- - DataFrame.corrwith - Series.corr + DataFrame.corrwith : Compute pairwise correlation between rows or + columns of two DataFrame objects. + Series.corr : Compute the correlation between two Series. Examples -------- @@ -7495,7 +7496,7 @@ def corrwith(self, other, axis=0, drop=False, method="pearson") -> Series: See Also -------- - DataFrame.corr + DataFrame.corr : Compute pairwise correlation of columns. """ axis = self._get_axis_number(axis) this = self._get_numeric_data() @@ -7900,7 +7901,8 @@ def idxmin(self, axis=0, skipna=True) -> Series: See Also -------- - Series.idxmin + Series.idxmin : : Return index *label* of the first occurrence + of minimum of values. Notes ----- @@ -7938,7 +7940,8 @@ def idxmax(self, axis=0, skipna=True) -> Series: See Also -------- - Series.idxmax + Series.idxmax : Return index *label* of the first occurrence + of maximum of values. Notes ----- diff --git a/pandas/core/series.py b/pandas/core/series.py index 9c0ff9780da3e..50ca5d048962a 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -552,7 +552,7 @@ def ravel(self, order="C"): See Also -------- - numpy.ndarray.ravel + numpy.ndarray.ravel : Return a flattened array. """ return self._values.ravel(order=order) @@ -2074,6 +2074,9 @@ def round(self, decimals=0, *args, **kwargs) -> "Series": decimals : int, default 0 Number of decimal places to round to. If decimals is negative, it specifies the number of positions to the left of the decimal point. + *args, **kwargs + Additional arguments and keywords have no effect but might be + accepted for compatibility with NumPy. Returns ------- @@ -2128,8 +2131,8 @@ def quantile(self, q=0.5, interpolation="linear"): See Also -------- - core.window.Rolling.quantile - numpy.percentile + core.window.Rolling.quantile : Calculate the %(name)s quantile. + numpy.percentile : Returns the q-th percentile(s) of the array elements. Examples -------- @@ -3147,7 +3150,7 @@ def argsort(self, axis=0, kind="quicksort", order=None) -> "Series": See Also -------- - numpy.ndarray.argsort + numpy.ndarray.argsort : Returns the indices that would sort this array. """ values = self._values mask = isna(values) From 15785852d76d4c5abe3f35c0fc1e2903057ed77a Mon Sep 17 00:00:00 2001 From: Adrian Mastronardi Date: Sat, 22 Feb 2020 16:27:13 -0300 Subject: [PATCH 2/8] DOC: fixing a duplicated double-colon typo --- pandas/core/frame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index b083c8e803fc3..6f812f78bb341 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -7901,7 +7901,7 @@ def idxmin(self, axis=0, skipna=True) -> Series: See Also -------- - Series.idxmin : : Return index *label* of the first occurrence + Series.idxmin : Return index *label* of the first occurrence of minimum of values. Notes From 88697a4c5b9b4725b1df47377ab886be7cf1e2c8 Mon Sep 17 00:00:00 2001 From: Adrian Mastronardi <7809331+AdrianMastronardi@users.noreply.github.com> Date: Thu, 27 Feb 2020 21:37:25 -0300 Subject: [PATCH 3/8] Update pandas/core/algorithms.py Co-Authored-By: Marc Garcia --- pandas/core/algorithms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 6cc47244ee76e..761442fe569e2 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -313,7 +313,7 @@ def unique(values): See Also -------- - Index.unique : Return Index with unique values from an Index object. + Index.unique : Return unique values from an Index. Series.unique : Return unique values of Series object. Examples From a0bfd97d1203adbeabceed058deffa2021d46d56 Mon Sep 17 00:00:00 2001 From: Adrian Mastronardi Date: Thu, 27 Feb 2020 21:50:05 -0300 Subject: [PATCH 4/8] DOC: Fix SA04 errors in docstrings xref #28792 following @datapythonista suggestion --- pandas/core/frame.py | 6 ++---- pandas/core/series.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 6f812f78bb341..cb01472c32e3c 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -7901,8 +7901,7 @@ def idxmin(self, axis=0, skipna=True) -> Series: See Also -------- - Series.idxmin : Return index *label* of the first occurrence - of minimum of values. + Series.idxmin : Return index of the minimum element. Notes ----- @@ -7940,8 +7939,7 @@ def idxmax(self, axis=0, skipna=True) -> Series: See Also -------- - Series.idxmax : Return index *label* of the first occurrence - of maximum of values. + Series.idxmax : Return index of the maximun element. Notes ----- diff --git a/pandas/core/series.py b/pandas/core/series.py index 50ca5d048962a..9f852d77f6596 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2131,7 +2131,7 @@ def quantile(self, q=0.5, interpolation="linear"): See Also -------- - core.window.Rolling.quantile : Calculate the %(name)s quantile. + core.window.Rolling.quantile : Calculate the rolling quantile. numpy.percentile : Returns the q-th percentile(s) of the array elements. Examples From 7433adff4fa92ebb5d2a6bb2986c5a8ebd1aae2b Mon Sep 17 00:00:00 2001 From: Adrian Mastronardi <7809331+AdrianMastronardi@users.noreply.github.com> Date: Fri, 28 Feb 2020 15:06:13 -0300 Subject: [PATCH 5/8] Update pandas/core/frame.py Co-Authored-By: Simon Hawkins --- pandas/core/frame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index cb01472c32e3c..94f5a508a3678 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -360,7 +360,7 @@ class DataFrame(NDFrame): DataFrame.from_dict : From dicts of Series, arrays, or dicts. read_csv : Read a comma-separated values (csv) file into DataFrame. read_table : Read general delimited file into DataFrame. - read_clipboard : Read text from clipboard and pass to read_table. + read_clipboard : Read text from clipboard into DataFrame. Examples -------- From 8f36a44547dba5997d21151607db3946226dd1c3 Mon Sep 17 00:00:00 2001 From: Adrian Mastronardi <7809331+AdrianMastronardi@users.noreply.github.com> Date: Fri, 28 Feb 2020 15:06:22 -0300 Subject: [PATCH 6/8] Update pandas/core/frame.py Co-Authored-By: Simon Hawkins --- pandas/core/frame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 94f5a508a3678..e0c7c2da73637 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -7292,7 +7292,7 @@ def corr(self, method="pearson", min_periods=1) -> "DataFrame": See Also -------- - DataFrame.corrwith : Compute pairwise correlation between rows or + DataFrame.corrwith : Compute pairwise correlation with another DataFrame or Series. columns of two DataFrame objects. Series.corr : Compute the correlation between two Series. From cdbd3cd808907621ecc6c381d00c2dd7b838f577 Mon Sep 17 00:00:00 2001 From: Adrian Mastronardi Date: Fri, 28 Feb 2020 17:41:31 -0300 Subject: [PATCH 7/8] Incorporating changes suggested by @simonjayhawkins --- pandas/core/frame.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index cb01472c32e3c..fed9ea060722b 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -360,7 +360,7 @@ class DataFrame(NDFrame): DataFrame.from_dict : From dicts of Series, arrays, or dicts. read_csv : Read a comma-separated values (csv) file into DataFrame. read_table : Read general delimited file into DataFrame. - read_clipboard : Read text from clipboard and pass to read_table. + read_clipboard : Read text from clipboard into DataFrame. Examples -------- @@ -7292,8 +7292,8 @@ def corr(self, method="pearson", min_periods=1) -> "DataFrame": See Also -------- - DataFrame.corrwith : Compute pairwise correlation between rows or - columns of two DataFrame objects. + DataFrame.corrwith : Compute pairwise correlation with another + DataFrame or Series. Series.corr : Compute the correlation between two Series. Examples From 9ab2c5a7ac0fbffa56312ed99b225cdfc59824e5 Mon Sep 17 00:00:00 2001 From: Adrian Mastronardi <7809331+AdrianMastronardi@users.noreply.github.com> Date: Tue, 3 Mar 2020 00:15:28 -0300 Subject: [PATCH 8/8] Update pandas/core/frame.py Co-Authored-By: Simon Hawkins --- pandas/core/frame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index b2af5f40dc44f..406ba894d9ff5 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8040,7 +8040,7 @@ def idxmax(self, axis=0, skipna=True) -> Series: See Also -------- - Series.idxmax : Return index of the maximun element. + Series.idxmax : Return index of the maximum element. Notes -----