From 47e6ac947665a507ef1d6aa4770da37bbaeafba7 Mon Sep 17 00:00:00 2001 From: Deepan Das Date: Thu, 31 Oct 2019 01:18:06 +0100 Subject: [PATCH 1/6] Fix SS06 formatting error #29254 --- pandas/core/frame.py | 28 ++++++++++++++++------------ pandas/core/generic.py | 11 ++++++----- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index f2606ce1b0d61..bfd6af1ccb887 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -310,10 +310,11 @@ class DataFrame(NDFrame): """ - Two-dimensional size-mutable, potentially heterogeneous tabular data - structure with labeled axes (rows and columns). Arithmetic operations - align on both row and column labels. Can be thought of as a dict-like - container for Series objects. The primary pandas data structure. + Two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns). + + Arithmetic operations align on both row and column labels. + Can be thought of as a dict-like container for Series objects. + The primary pandas data structure. Parameters ---------- @@ -4798,9 +4799,10 @@ def dropna(self, axis=0, how="any", thresh=None, subset=None, inplace=False): def drop_duplicates(self, subset=None, keep="first", inplace=False): """ - Return DataFrame with duplicate rows removed, optionally only - considering certain columns. Indexes, including time indexes - are ignored. + Return DataFrame with duplicate rows removed. + + Optionally only considers certain columns. + Indexes, including time indexes are ignored. Parameters ---------- @@ -4834,8 +4836,9 @@ def drop_duplicates(self, subset=None, keep="first", inplace=False): def duplicated(self, subset=None, keep="first"): """ - Return boolean Series denoting duplicate rows, optionally only - considering certain columns. + Return boolean Series denoting duplicate rows. + + Optionally only considers certain columns. Parameters ---------- @@ -7536,9 +7539,10 @@ def cov(self, min_periods=None): def corrwith(self, other, axis=0, drop=False, method="pearson"): """ - Compute pairwise correlation between rows or columns of DataFrame - with rows or columns of Series or DataFrame. DataFrames are first - aligned along both axes before computing the correlations. + Compute pairwise correlation between rows or columns of DataFrame. + + Correlation is computed with rows or columns of Series or DataFrame. + DataFrames are first aligned along both axes before computing the correlations. Parameters ---------- diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e15332a5277b9..3cc0bd1afcbe3 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9965,9 +9965,10 @@ def abs(self): def describe(self, percentiles=None, include=None, exclude=None): """ - Generate descriptive statistics that summarize the central tendency, - dispersion and shape of a dataset's distribution, excluding - ``NaN`` values. + Generate descriptive statistics that summarizes a dataset. + + Statistics summarizes the central tendency, dispersion and + shape of a dataset's distribution, excluding ``NaN`` values. Analyzes both numeric and object series, as well as ``DataFrame`` column sets of mixed data types. The output @@ -10649,7 +10650,7 @@ def compound(self, axis=None, skipna=None, level=None): name, name2, axis_descr, - "Return unbiased skew over requested axis\nNormalized by N-1.", + "Return unbiased skew over requested axis normalized by N-1.", nanops.nanskew, ) cls.kurt = _make_stat_function( @@ -10659,7 +10660,7 @@ def compound(self, axis=None, skipna=None, level=None): name2, axis_descr, "Return unbiased kurtosis over requested axis using Fisher's " - "definition of\nkurtosis (kurtosis of normal == 0.0). Normalized " + "definition of kurtosis(kurtosis of normal == 0.0).\nNormalized " "by N-1.", nanops.nankurt, ) From e737e7f1725f3dd1d18fecb64f3381f6eac64a78 Mon Sep 17 00:00:00 2001 From: Deepan Das Date: Thu, 31 Oct 2019 01:51:59 +0100 Subject: [PATCH 2/6] Fix SS06 formatting error #29254 with Appender Functions --- pandas/core/generic.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 3cc0bd1afcbe3..91a52a837ae4a 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5156,8 +5156,7 @@ def pipe(self, func, *args, **kwargs): _shared_docs[ "transform" ] = """ - Call ``func`` on self producing a %(klass)s with transformed values - and that has the same axis length as self. + Call ``func`` on self producing a %(klass)s with transformed values and that has the same axis length as self. Parameters ---------- @@ -8741,8 +8740,7 @@ def ranker(data): _shared_docs[ "align" ] = """ - Align two objects on their axes with the - specified join method for each axis Index. + Align two objects on their axes with the specified join method for each axis Index. Parameters ---------- @@ -9966,14 +9964,11 @@ def abs(self): def describe(self, percentiles=None, include=None, exclude=None): """ Generate descriptive statistics that summarizes a dataset. - - Statistics summarizes the central tendency, dispersion and + Statistics summarizes the central tendency, dispersion and shape of a dataset's distribution, excluding ``NaN`` values. - Analyzes both numeric and object series, as well - as ``DataFrame`` column sets of mixed data types. The output - will vary depending on what is provided. Refer to the notes - below for more detail. + Analyzes both numeric and object series, as well as ``DataFrame`` column sets of mixed data types. + The output will vary depending on what is provided. Refer to the notes below for more detail. Parameters ---------- @@ -10659,9 +10654,8 @@ def compound(self, axis=None, skipna=None, level=None): name, name2, axis_descr, - "Return unbiased kurtosis over requested axis using Fisher's " - "definition of kurtosis(kurtosis of normal == 0.0).\nNormalized " - "by N-1.", + "Return unbiased kurtosis over requested axis using Fisher's definition of kurtosis(kurtosis of normal == 0.0)." + "\n\nNormalized by N-1.", nanops.nankurt, ) cls.kurtosis = cls.kurt From 3251991c449a4c47182f42e2aa5f39a04d8accce Mon Sep 17 00:00:00 2001 From: Deepan Das Date: Thu, 31 Oct 2019 02:49:44 +0100 Subject: [PATCH 3/6] fixed formatting issues --- pandas/core/frame.py | 17 +++++++++-------- pandas/core/generic.py | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index bfd6af1ccb887..3a7ddbc06c78c 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -310,11 +310,12 @@ class DataFrame(NDFrame): """ - Two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns). - - Arithmetic operations align on both row and column labels. + Two-dimensional size-mutable, potentially heterogeneous tabular data structure. + + Data Structure has labeled axes (rows and columns). + Arithmetic operations align on both row and column labels. Can be thought of as a dict-like container for Series objects. - The primary pandas data structure. + This is the primary pandas data structure. Parameters ---------- @@ -4800,8 +4801,8 @@ def dropna(self, axis=0, how="any", thresh=None, subset=None, inplace=False): def drop_duplicates(self, subset=None, keep="first", inplace=False): """ Return DataFrame with duplicate rows removed. - - Optionally only considers certain columns. + + Optionally only considers certain columns. Indexes, including time indexes are ignored. Parameters @@ -7540,8 +7541,8 @@ def cov(self, min_periods=None): def corrwith(self, other, axis=0, drop=False, method="pearson"): """ Compute pairwise correlation between rows or columns of DataFrame. - - Correlation is computed with rows or columns of Series or DataFrame. + + Correlation is computed with rows or columns of Series or DataFrame. DataFrames are first aligned along both axes before computing the correlations. Parameters diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 91a52a837ae4a..20fbfbd81c2e1 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5156,7 +5156,7 @@ def pipe(self, func, *args, **kwargs): _shared_docs[ "transform" ] = """ - Call ``func`` on self producing a %(klass)s with transformed values and that has the same axis length as self. + Call ``func`` on self producing a %(klass)s with transformed valuesnd that has the same axis length as self. Parameters ---------- From 8f9464a41fe7a5f1ebcea2a412fbb260498a819c Mon Sep 17 00:00:00 2001 From: Deepan Das Date: Thu, 31 Oct 2019 02:56:06 +0100 Subject: [PATCH 4/6] Correcting spelling error --- pandas/core/frame.py | 2 +- pandas/core/generic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 3a7ddbc06c78c..a1f82b7154524 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -4838,7 +4838,7 @@ def drop_duplicates(self, subset=None, keep="first", inplace=False): def duplicated(self, subset=None, keep="first"): """ Return boolean Series denoting duplicate rows. - + Optionally only considers certain columns. Parameters diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 20fbfbd81c2e1..91a52a837ae4a 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5156,7 +5156,7 @@ def pipe(self, func, *args, **kwargs): _shared_docs[ "transform" ] = """ - Call ``func`` on self producing a %(klass)s with transformed valuesnd that has the same axis length as self. + Call ``func`` on self producing a %(klass)s with transformed values and that has the same axis length as self. Parameters ---------- From fd8037c8775592e201db79c702bf7bf8e40776fe Mon Sep 17 00:00:00 2001 From: Deepan Das Date: Thu, 31 Oct 2019 03:09:40 +0100 Subject: [PATCH 5/6] fixing pep8 issues --- pandas/core/generic.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 91a52a837ae4a..d87f4c03e7f36 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5156,7 +5156,9 @@ def pipe(self, func, *args, **kwargs): _shared_docs[ "transform" ] = """ - Call ``func`` on self producing a %(klass)s with transformed values and that has the same axis length as self. + Call ``func`` on self producing a %(klass)s with transformed values. + + %(klass)s has the same axis length as self. Parameters ---------- @@ -8740,7 +8742,7 @@ def ranker(data): _shared_docs[ "align" ] = """ - Align two objects on their axes with the specified join method for each axis Index. + Align two objects on their axes with the specified join for each axis Index. Parameters ---------- @@ -9967,8 +9969,10 @@ def describe(self, percentiles=None, include=None, exclude=None): Statistics summarizes the central tendency, dispersion and shape of a dataset's distribution, excluding ``NaN`` values. - Analyzes both numeric and object series, as well as ``DataFrame`` column sets of mixed data types. - The output will vary depending on what is provided. Refer to the notes below for more detail. + Analyzes both numeric and object series. + In addition, it also analyses ``DataFrame`` column sets of mixed data types. + The output will vary depending on what is provided. + Refer to the notes below for more detail. Parameters ---------- @@ -10654,8 +10658,9 @@ def compound(self, axis=None, skipna=None, level=None): name, name2, axis_descr, - "Return unbiased kurtosis over requested axis using Fisher's definition of kurtosis(kurtosis of normal == 0.0)." - "\n\nNormalized by N-1.", + "Return unbiased kurtosis over requested axis." + "\n\nFisher's definition of kurtosis is used(kurtosis of normal == 0.0)." + "\nNormalized by N-1.", nanops.nankurt, ) cls.kurtosis = cls.kurt From f95cfebfe3cb34ef5f7fc88623688d264e48782d Mon Sep 17 00:00:00 2001 From: Deepan Das Date: Thu, 31 Oct 2019 08:37:09 +0100 Subject: [PATCH 6/6] Added punctuation --- 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 a1f82b7154524..84b2d266426c0 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -4803,7 +4803,7 @@ def drop_duplicates(self, subset=None, keep="first", inplace=False): Return DataFrame with duplicate rows removed. Optionally only considers certain columns. - Indexes, including time indexes are ignored. + Indexes, including time indexes, are ignored. Parameters ----------