diff --git a/pandas/core/base.py b/pandas/core/base.py index 2fb552af717fc..1a2f906f97152 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -1073,7 +1073,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 @@ -1096,7 +1096,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 @@ -1137,7 +1137,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 @@ -1486,7 +1486,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 301426d237d19..feee6dca23ac8 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 ------- @@ -2001,7 +2001,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 ------- @@ -2056,7 +2056,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 @@ -3413,7 +3413,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 ------- @@ -4923,9 +4923,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 @@ -5122,11 +5122,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 diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 66deacac37789..caaf55546189c 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 ------- 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 ---------- 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. diff --git a/pandas/core/reshape/tile.py b/pandas/core/reshape/tile.py index 95534755b8beb..073bb4707f890 100644 --- a/pandas/core/reshape/tile.py +++ b/pandas/core/reshape/tile.py @@ -275,17 +275,18 @@ 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 ---------- 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