From 9380a9309717fb3194a47bbbc75a5e2fac1e5ba2 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Sat, 2 Nov 2019 17:44:21 +0000 Subject: [PATCH 1/7] fix PR09 errors in pandas.Index --- pandas/core/base.py | 8 ++++---- pandas/core/indexes/base.py | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/pandas/core/base.py b/pandas/core/base.py index 9586d49c555ff..57b9781118638 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -1066,7 +1066,7 @@ def argmax(self, axis=None, skipna=True, *args, **kwargs): Parameters ---------- axis : {None} - Dummy argument for consistency with Series + Dummy argument for consistency with Series. skipna : bool, default True Returns @@ -1089,7 +1089,7 @@ def min(self, axis=None, skipna=True, *args, **kwargs): Parameters ---------- axis : {None} - Dummy argument for consistency with Series + Dummy argument for consistency with Series. skipna : bool, default True Returns @@ -1130,7 +1130,7 @@ def argmin(self, axis=None, skipna=True, *args, **kwargs): Parameters ---------- axis : {None} - Dummy argument for consistency with Series + Dummy argument for consistency with Series. skipna : bool, default True Returns @@ -1479,7 +1479,7 @@ def memory_usage(self, deep=False): ---------- deep : bool Introspect the data deeply, interrogate - `object` dtypes for system-level memory consumption + `object` dtypes for system-level memory consumption. Returns ------- diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 187c7e2f3a7f7..81188a85aa34a 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -176,11 +176,11 @@ class Index(IndexOpsMixin, PandasObject): If an actual dtype is provided, we coerce to that dtype if it's safe. Otherwise, an error will be raised. copy : bool - Make a copy of input ndarray + Make a copy of input ndarray. name : object - Name to be stored in the index + Name to be stored in the index. tupleize_cols : bool (default: True) - When True, attempt to create a MultiIndex if possible + When True, attempt to create a MultiIndex if possible. See Also -------- @@ -791,13 +791,13 @@ def astype(self, dtype, copy=True): Parameters ---------- indices : list - Indices to be taken + Indices to be taken. axis : int, optional The axis over which to select values, always 0. allow_fill : bool, default True fill_value : bool, default None If allow_fill=True and fill_value is not None, indices specified by - -1 is regarded as NA. If Index doesn't hold NA, raise ValueError + -1 is regarded as NA. If Index doesn't hold NA, raise ValueError. Returns ------- @@ -1077,7 +1077,7 @@ def to_native_types(self, slicer=None, **kwargs): 2) quoting : bool or None Whether or not there are quoted values in `self` 3) date_format : str - The format used to represent date-like values + The format used to represent date-like values. Returns ------- @@ -2004,7 +2004,7 @@ def notna(self): downcast : dict, default is None a dict of item->dtype of what to downcast if possible, or the string 'infer' which will try to downcast to an appropriate - equal type (e.g. float64 to int64 if possible) + equal type (e.g. float64 to int64 if possible). Returns ------- @@ -2059,7 +2059,7 @@ def dropna(self, how="any"): Parameters ---------- level : int or str, optional, default None - Only return values from specified level (for MultiIndex) + Only return values from specified level (for MultiIndex). .. versionadded:: 0.23.0 @@ -3416,7 +3416,7 @@ def _reindex_non_unique(self, target): return_indexers : bool, default False sort : bool, default False Sort the join keys lexicographically in the result Index. If False, - the order of the join keys depends on the join type (how keyword) + the order of the join keys depends on the join type (how keyword). Returns ------- @@ -4926,9 +4926,9 @@ def slice_indexer(self, start=None, end=None, step=None, kind=None): Parameters ---------- start : label, default None - If None, defaults to the beginning + If None, defaults to the beginning. end : label, default None - If None, defaults to the end + If None, defaults to the end. step : int, default None kind : str, default None @@ -5125,11 +5125,11 @@ def slice_locs(self, start=None, end=None, step=None, kind=None): Parameters ---------- start : label, default None - If None, defaults to the beginning + If None, defaults to the beginning. end : label, default None - If None, defaults to the end + If None, defaults to the end. step : int, defaults None - If None, defaults to 1 + If None, defaults to 1. kind : {'ix', 'loc', 'getitem'} or None Returns From 390d22ba3caacb57f1e5e2b6422475dd14337334 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 4 Nov 2019 14:13:20 +0000 Subject: [PATCH 2/7] fix PR09 in common docs for Indexes --- pandas/core/indexes/numeric.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/indexes/numeric.py b/pandas/core/indexes/numeric.py index e83360dc701f3..46bb8eafee3b9 100644 --- a/pandas/core/indexes/numeric.py +++ b/pandas/core/indexes/numeric.py @@ -176,9 +176,9 @@ def _union(self, other, sort): data : array-like (1-dimensional) dtype : NumPy dtype (default: %(dtype)s) copy : bool - Make a copy of input ndarray + Make a copy of input ndarray. name : object - Name to be stored in the index + Name to be stored in the index. Attributes ---------- From b9291f19675c152d70cf5490f3eab2e4f0789992 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 4 Nov 2019 14:25:16 +0000 Subject: [PATCH 3/7] PR09 and PR08 in pandas.MultiIndex.set_levels --- pandas/core/indexes/multi.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index f968a9eb4103c..a04b7e9eefd96 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -737,19 +737,18 @@ def _set_levels( def set_levels(self, levels, level=None, inplace=False, verify_integrity=True): """ - Set new levels on MultiIndex. Defaults to returning - new index. + Set new levels on MultiIndex. Defaults to returning new index. Parameters ---------- levels : sequence or list of sequence - new level(s) to apply + New level(s) to apply. level : int, level name, or sequence of int/level names (default None) - level(s) to set (None for all levels) + Level(s) to set (None for all levels). inplace : bool - if True, mutates in place + If True, mutates in place. verify_integrity : bool (default True) - if True, checks that levels and codes are compatible + If True, checks that levels and codes are compatible. Returns ------- From 090a1c0494d3760f256190e8fc31978fc3223b3d Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 4 Nov 2019 14:29:51 +0000 Subject: [PATCH 4/7] add period for PR09 error --- pandas/core/indexes/range.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/range.py b/pandas/core/indexes/range.py index 6e2d500f4c5ab..5fa3431fc97c0 100644 --- a/pandas/core/indexes/range.py +++ b/pandas/core/indexes/range.py @@ -51,7 +51,7 @@ class RangeIndex(Int64Index): stop : int (default: 0) step : int (default: 1) name : object, optional - Name to be stored in the index + Name to be stored in the index. copy : bool, default False Unused, accepted for homogeneity with other index types. From 84fe52e81ed53a5c947ddc7f92bbe7bc8a925f96 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 4 Nov 2019 14:52:09 +0000 Subject: [PATCH 5/7] add period --- pandas/core/reshape/tile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/reshape/tile.py b/pandas/core/reshape/tile.py index 95534755b8beb..5138d7a214635 100644 --- a/pandas/core/reshape/tile.py +++ b/pandas/core/reshape/tile.py @@ -285,7 +285,7 @@ def qcut( x : 1d ndarray or Series q : int or list-like of int Number of quantiles. 10 for deciles, 4 for quartiles, etc. Alternately - array of quantiles, e.g. [0, .25, .5, .75, 1.] for quartiles + array of quantiles, e.g. [0, .25, .5, .75, 1.] for quartiles. labels : array or bool, default None Used as labels for the resulting bins. Must be of the same length as the resulting bins. If False, return only integer indicators of the From ab5d61aecf208987fa69b6e6928fb0ddd2ff08b1 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 4 Nov 2019 14:55:26 +0000 Subject: [PATCH 6/7] reformat summary --- pandas/core/reshape/tile.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pandas/core/reshape/tile.py b/pandas/core/reshape/tile.py index 5138d7a214635..72b8dbde504e4 100644 --- a/pandas/core/reshape/tile.py +++ b/pandas/core/reshape/tile.py @@ -275,10 +275,11 @@ def qcut( duplicates: str = "raise", ): """ - Quantile-based discretization function. Discretize variable into - equal-sized buckets based on rank or based on sample quantiles. For example - 1000 values for 10 quantiles would produce a Categorical object indicating - quantile membership for each data point. + Quantile-based discretization function. + + Discretize variable into equal-sized buckets based on rank or based + on sample quantiles. For example 1000 values for 10 quantiles would + produce a Categorical object indicating quantile membership for each data point. Parameters ---------- From cfca25cb1998d2e16f4082cfa8f6183892a923fd Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 4 Nov 2019 14:59:48 +0000 Subject: [PATCH 7/7] whitespace --- pandas/core/reshape/tile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/reshape/tile.py b/pandas/core/reshape/tile.py index 72b8dbde504e4..073bb4707f890 100644 --- a/pandas/core/reshape/tile.py +++ b/pandas/core/reshape/tile.py @@ -275,10 +275,10 @@ def qcut( duplicates: str = "raise", ): """ - Quantile-based discretization function. + Quantile-based discretization function. - Discretize variable into equal-sized buckets based on rank or based - on sample quantiles. For example 1000 values for 10 quantiles would + Discretize variable into equal-sized buckets based on rank or based + on sample quantiles. For example 1000 values for 10 quantiles would produce a Categorical object indicating quantile membership for each data point. Parameters