diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index bab1127e6e539..6f56d0be1adc5 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -636,7 +636,7 @@ def from_codes(cls, codes, categories=None, ordered=None, dtype=None): Parameters ---------- - codes : array-like, integers + codes : array-like of int An integer array, where each integer points to a category in categories or dtype.categories, or else is -1 for NaN. categories : index-like, optional @@ -647,7 +647,7 @@ def from_codes(cls, codes, categories=None, ordered=None, dtype=None): Whether or not this categorical is treated as an ordered categorical. If not given here or in `dtype`, the resulting categorical will be unordered. - dtype : CategoricalDtype or the string "category", optional + dtype : CategoricalDtype or "category", optional If :class:`CategoricalDtype`, cannot be used together with `categories` or `ordered`. diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index 958650e3842fa..c682f3884603c 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -670,7 +670,7 @@ def value_counts(self, dropna=False): Parameters ---------- - dropna : boolean, default True + dropna : bool, default True Don't include counts of NaT values. Returns @@ -728,7 +728,7 @@ def _maybe_mask_results(self, result, fill_value=iNaT, convert=None): ---------- result : a ndarray fill_value : object, default iNaT - convert : string/dtype or None + convert : str, dtype or None Returns ------- @@ -1168,7 +1168,7 @@ def _time_shift(self, periods, freq=None): ---------- periods : int Number of periods to shift by. - freq : pandas.DateOffset, pandas.Timedelta, or string + freq : pandas.DateOffset, pandas.Timedelta, or str Frequency increment to shift by. """ if freq is not None and freq != self.freq: diff --git a/pandas/core/arrays/integer.py b/pandas/core/arrays/integer.py index 7b03bf35faf25..630c3e50f2c09 100644 --- a/pandas/core/arrays/integer.py +++ b/pandas/core/arrays/integer.py @@ -95,7 +95,7 @@ def integer_array(values, dtype=None, copy=False): values : 1D list-like dtype : dtype, optional dtype to coerce - copy : boolean, default False + copy : bool, default False Returns ------- @@ -140,8 +140,8 @@ def coerce_to_array(values, dtype, mask=None, copy=False): ---------- values : 1D list-like dtype : integer dtype - mask : boolean 1D array, optional - copy : boolean, default False + mask : bool 1D array, optional + copy : bool, default False if True, copy the input Returns @@ -542,7 +542,7 @@ def value_counts(self, dropna=True): Parameters ---------- - dropna : boolean, default True + dropna : bool, default True Don't include counts of NaN. Returns diff --git a/pandas/core/arrays/period.py b/pandas/core/arrays/period.py index 43208d98abd3c..a21d9e67e49e5 100644 --- a/pandas/core/arrays/period.py +++ b/pandas/core/arrays/period.py @@ -444,7 +444,7 @@ def to_timestamp(self, freq=None, how="start"): Parameters ---------- - freq : string or DateOffset, optional + freq : str or DateOffset, optional Target frequency. The default is 'D' for week or longer, 'S' otherwise how : {'s', 'e', 'start', 'end'} @@ -515,7 +515,7 @@ def _time_shift(self, periods, freq=None): ---------- periods : int Number of periods to shift by. - freq : pandas.DateOffset, pandas.Timedelta, or string + freq : pandas.DateOffset, pandas.Timedelta, or str Frequency increment to shift by. """ if freq is not None: diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index 328c7566d8e8d..5a5b87069e81a 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -1006,7 +1006,7 @@ def maybe_infer_to_datetimelike(value, convert_dates=False): Parameters ---------- value : np.array / Series / Index / list-like - convert_dates : boolean, default False + convert_dates : bool, default False if True try really hard to convert dates (such as datetime.date), other leave inferred dtype 'date' alone @@ -1439,7 +1439,7 @@ def maybe_cast_to_integer_array(arr, dtype, copy=False): The array to cast. dtype : str, np.dtype The integer dtype to cast the array to. - copy: boolean, default False + copy: bool, default False Whether to make a copy of the array before returning. Returns diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index 41677af7b1721..3f4ebc88c1c8a 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -152,7 +152,7 @@ def ensure_int_or_float(arr: ArrayLike, copy: bool = False) -> np.array: ---------- arr : array-like The array whose data type we want to enforce. - copy: boolean + copy: bool Whether to copy the original array or reuse it in place, if possible. diff --git a/pandas/core/dtypes/concat.py b/pandas/core/dtypes/concat.py index 1094ab22238e9..bd1ed0bb7d318 100644 --- a/pandas/core/dtypes/concat.py +++ b/pandas/core/dtypes/concat.py @@ -192,10 +192,10 @@ def union_categoricals(to_union, sort_categories=False, ignore_order=False): ---------- to_union : list-like of Categorical, CategoricalIndex, or Series with dtype='category' - sort_categories : boolean, default False + sort_categories : bool, default False If true, resulting categories will be lexsorted, otherwise they will be ordered as they appear in the data. - ignore_order : boolean, default False + ignore_order : bool, default False If true, the ordered attribute of the Categoricals will be ignored. Results in an unordered categorical. diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index fcdb89dd8a334..ae6f2ed289248 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -85,7 +85,7 @@ def find( """ Parameters ---------- - dtype : Type[ExtensionDtype] or string + dtype : Type[ExtensionDtype] or str Returns ------- diff --git a/pandas/core/dtypes/missing.py b/pandas/core/dtypes/missing.py index 56bfbefdbf248..322011eb8e263 100644 --- a/pandas/core/dtypes/missing.py +++ b/pandas/core/dtypes/missing.py @@ -521,7 +521,7 @@ def na_value_for_dtype(dtype, compat=True): Parameters ---------- dtype : string / dtype - compat : boolean, default True + compat : bool, default True Returns -------