diff --git a/pandas/core/base.py b/pandas/core/base.py index 2d5ffb5e91392..910b05c47071d 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -1289,17 +1289,17 @@ def value_counts( Parameters ---------- - normalize : boolean, default False + normalize : bool, default False If True then the object returned will contain the relative frequencies of the unique values. - sort : boolean, default True + sort : bool, default True Sort by frequencies. - ascending : boolean, default False + ascending : bool, default False Sort in ascending order. - bins : integer, optional + bins : int, optional Rather than count values, group them into half-open bins, a convenience for ``pd.cut``, only works with numeric data. - dropna : boolean, default True + dropna : bool, default True Don't include counts of NaN. Returns @@ -1496,7 +1496,7 @@ def memory_usage(self, deep=False): size_hint="", sort=textwrap.dedent( """\ - sort : boolean, default False + sort : bool, default False Sort `uniques` and shuffle `labels` to maintain the relationship. """ diff --git a/pandas/core/generic.py b/pandas/core/generic.py index b427b1f0ac858..a62a2b2fdbf83 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2313,7 +2313,7 @@ def to_json( floating point values. force_ascii : bool, default True Force encoded string to be ASCII. - date_unit : string, default 'ms' (milliseconds) + date_unit : str, default 'ms' (milliseconds) The time unit to encode to, governs timestamp and ISO8601 precision. One of 's', 'ms', 'us', 'ns' for second, millisecond, microsecond, and nanosecond respectively. @@ -2533,8 +2533,9 @@ def to_msgpack(self, path_or_buf=None, encoding="utf-8", **kwargs): Parameters ---------- - path : string File path, buffer-like, or None - if None, return generated bytes + path : str, buffer-like, or None + Destination for the serialized object. + If None, return generated bytes append : bool whether to append to an existing msgpack (default is False) compress : type of compressor (zlib or blosc), default to None (no @@ -4621,8 +4622,9 @@ def filter(self, items=None, like=None, regex=None, axis=None): Keep labels from axis for which "like in label == True". regex : str (regular expression) Keep labels from axis for which re.search(regex, label) == True. - axis : int or string axis name - The axis to filter on. By default this is the info axis, + axis : {0 or ‘index’, 1 or ‘columns’, None}, default None + The axis to filter on, expressed either as an index (int) + or axis name (str). By default this is the info axis, 'index' for Series, 'columns' for DataFrame. Returns @@ -4855,7 +4857,7 @@ def sample( random_state : int or numpy.random.RandomState, optional Seed for the random number generator (if int), or numpy RandomState object. - axis : int or string, optional + axis : {0 or ‘index’, 1 or ‘columns’, None}, default None Axis to sample. Accepts axis number or name. Default is stat axis for given data type (0 for Series and DataFrames). @@ -8462,7 +8464,7 @@ def first(self, offset): Parameters ---------- - offset : string, DateOffset, dateutil.relativedelta + offset : str, DateOffset, dateutil.relativedelta Returns ------- @@ -8525,7 +8527,7 @@ def last(self, offset): Parameters ---------- - offset : string, DateOffset, dateutil.relativedelta + offset : str, DateOffset, dateutil.relativedelta Returns ------- @@ -9133,7 +9135,7 @@ def _where( Parameters ---------- - cond : boolean %(klass)s, array-like, or callable + cond : bool %(klass)s, array-like, or callable Where `cond` is %(cond)s, keep the original value. Where %(cond_rev)s, replace with corresponding value from `other`. If `cond` is callable, it is computed on the %(klass)s and @@ -9440,9 +9442,10 @@ def tshift(self, periods=1, freq=None, axis=0): ---------- periods : int Number of periods to move, can be positive or negative - freq : DateOffset, timedelta, or time rule string, default None - Increment to use from the tseries module or time rule (e.g. 'EOM') - axis : int or basestring + freq : DateOffset, timedelta, or str, default None + Increment to use from the tseries module + or time rule expressed as a string (e.g. 'EOM') + axis : {0 or ‘index’, 1 or ‘columns’, None}, default 0 Corresponds to the axis that contains the Index Returns @@ -9500,9 +9503,9 @@ def truncate(self, before=None, after=None, axis=None, copy=True): Parameters ---------- - before : date, string, int + before : date, str, int Truncate all rows before this index value. - after : date, string, int + after : date, str, int Truncate all rows after this index value. axis : {0 or 'index', 1 or 'columns'}, optional Axis to truncate. Truncates the index (rows) by default. @@ -10311,7 +10314,7 @@ def _check_percentile(self, q): How to handle NAs before computing percent changes. limit : int, default None The number of consecutive NAs to fill before stopping. - freq : DateOffset, timedelta, or offset alias string, optional + freq : DateOffset, timedelta, or str, optional Increment to use from time series API (e.g. 'M' or BDay()). **kwargs Additional keyword arguments are passed into diff --git a/pandas/core/series.py b/pandas/core/series.py index 6fb39c422de93..46b95d56c16c2 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -1788,7 +1788,7 @@ def to_sparse(self, kind="block", fill_value=None): Parameters ---------- - kind : {'block', 'integer'}, default 'block' + kind : {'block', 'int'}, default 'block' fill_value : float, defaults to NaN (missing) Value to use for filling NaN values. diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index d3c9e8ccfa51c..0d9d54a3569db 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -1145,7 +1145,7 @@ def kde(self, bw_method=None, ind=None, **kwargs): 'scott', 'silverman', a scalar constant or a callable. If None (default), 'scott' is used. See :class:`scipy.stats.gaussian_kde` for more information. - ind : NumPy array or integer, optional + ind : NumPy array or int, optional Evaluation points for the estimated PDF. If None (default), 1000 equally spaced points are used. If `ind` is a NumPy array, the KDE is evaluated at the points passed. If `ind` is an integer,