From 12299636bb9a79860357860e27896cd884554921 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:19:11 +0100 Subject: [PATCH 01/15] updated boolean to bool for api.extension.extensionarray methods --- pandas/core/arrays/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index 0778b6726d104..389eafd2391c0 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -177,7 +177,7 @@ def _from_sequence(cls, scalars, dtype=None, copy=False): dtype : dtype, optional Construct for this particular dtype. This should be a Dtype compatible with the ExtensionArray. - copy : boolean, default False + copy : bool, default False If True, copy the underlying data. Returns @@ -200,7 +200,7 @@ def _from_sequence_of_strings(cls, strings, dtype=None, copy=False): dtype : dtype, optional Construct for this particular dtype. This should be a Dtype compatible with the ExtensionArray. - copy : boolean, default False + copy : bool, default False If True, copy the underlying data. Returns From 34db4a36587e8180a9e46f923b626d7130deb7e5 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:22:45 +0100 Subject: [PATCH 02/15] updating categorical.from codes args with type string to str and boolean to bool --- pandas/core/arrays/categorical.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 33d1de01fa3db..027519c1c1b34 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -634,7 +634,7 @@ def from_codes(cls, codes, categories=None, ordered=None, dtype=None): Parameters ---------- - codes : array-like, integers + codes : array-like, 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 @@ -645,7 +645,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 the str "category", optional If :class:`CategoricalDtype`, cannot be used together with `categories` or `ordered`. From ad9e2ce5aae378d3b36cf7d57c51c1b4019ea578 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:24:08 +0100 Subject: [PATCH 03/15] converting DatetimeLikeArrayMixin.value_count arg type from boolean to bool --- pandas/core/arrays/datetimelike.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index bda5f8f4326f1..ef188e1246c5b 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 From 78d1853c17f72bf3d2afed3c7419270e1383f06e Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:25:43 +0100 Subject: [PATCH 04/15] converting methods in datetimelike module with string args to str --- pandas/core/arrays/datetimelike.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index ef188e1246c5b..12af166fecf0a 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -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: From d0e9bd4e3a15372513b65f98739391fdf25bdcf1 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:29:02 +0100 Subject: [PATCH 05/15] converting method arg types boolean to bool in integer.py --- pandas/core/arrays/integer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 From 3b5347f5281b25dc64bb84b25c97b5d372371d94 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:30:55 +0100 Subject: [PATCH 06/15] converting method arg types string to str in period.py --- pandas/core/arrays/period.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/period.py b/pandas/core/arrays/period.py index f2d74794eadf5..3f7572e101c28 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: From 9b64f963582db5d728e7209c988f0412f6c6ffad Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:37:25 +0100 Subject: [PATCH 07/15] converting boolean to bool in docstring in cast.py --- pandas/core/dtypes/cast.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index 5801384bf8db9..a86834bcc5672 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -949,7 +949,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 @@ -1382,7 +1382,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 From 6fca0120437d3354eaac876ff1db085053925831 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:39:35 +0100 Subject: [PATCH 08/15] converting boolean to bool in common.py --- pandas/core/dtypes/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 653590694afab8e85c9a29cbc2c8bedd889d71ea Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:41:01 +0100 Subject: [PATCH 09/15] converting boolean to bool in concat.py --- pandas/core/dtypes/concat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. From cd846686558da27edc68a5e0385daddce110f32f Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:42:32 +0100 Subject: [PATCH 10/15] converting string to str in dtypes.py --- pandas/core/dtypes/dtypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ------- From 5828d243273e2db0437b46247afa0a1da8fa53db Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:44:01 +0100 Subject: [PATCH 11/15] converting boolean to bool in missing.py --- pandas/core/dtypes/missing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/dtypes/missing.py b/pandas/core/dtypes/missing.py index cd87fbef02e4f..6e83cea4a6013 100644 --- a/pandas/core/dtypes/missing.py +++ b/pandas/core/dtypes/missing.py @@ -520,7 +520,7 @@ def na_value_for_dtype(dtype, compat=True): Parameters ---------- dtype : string / dtype - compat : boolean, default True + compat : bool, default True Returns ------- From 1c33d6f2d527f9c3ddd056c3ff80ee9b30457461 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Fri, 11 Oct 2019 19:47:37 +0100 Subject: [PATCH 12/15] change to array-like of int --- pandas/core/arrays/categorical.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 027519c1c1b34..15de7804b099c 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -634,7 +634,7 @@ def from_codes(cls, codes, categories=None, ordered=None, dtype=None): Parameters ---------- - codes : array-like, int + 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 @@ -646,7 +646,7 @@ def from_codes(cls, codes, categories=None, ordered=None, dtype=None): categorical. If not given here or in `dtype`, the resulting categorical will be unordered. dtype : CategoricalDtype or the str "category", optional - If :class:`CategoricalDtype`, cannot be used together with + If :class:`Categoarray-like, intricalDtype`, cannot be used together with `categories` or `ordered`. .. versionadded:: 0.24.0 From 8b362d28fc328aceded31266a8e93db1f562fca7 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Fri, 11 Oct 2019 19:49:43 +0100 Subject: [PATCH 13/15] change to 'category' from the str 'category' --- pandas/core/arrays/categorical.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 15de7804b099c..4896bd75af125 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -645,7 +645,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 str "category", optional + dtype : CategoricalDtype or "category", optional If :class:`Categoarray-like, intricalDtype`, cannot be used together with `categories` or `ordered`. From 073e45f40df9273877e3537d342652d0b00a6918 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Fri, 11 Oct 2019 19:51:03 +0100 Subject: [PATCH 14/15] changed / to , --- pandas/core/arrays/datetimelike.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index 12af166fecf0a..6709017d35601 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -728,7 +728,7 @@ def _maybe_mask_results(self, result, fill_value=iNaT, convert=None): ---------- result : a ndarray fill_value : object, default iNaT - convert : str/dtype or None + convert : str, dtype or None Returns ------- From a30457af230ad9a81884b4e087308ffb33d2349d Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Fri, 11 Oct 2019 20:01:31 +0100 Subject: [PATCH 15/15] catrgorical fix --- pandas/core/arrays/categorical.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index ede68f6f7515c..6f56d0be1adc5 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -648,7 +648,7 @@ def from_codes(cls, codes, categories=None, ordered=None, dtype=None): categorical. If not given here or in `dtype`, the resulting categorical will be unordered. dtype : CategoricalDtype or "category", optional - If :class:`Categoarray-like, intricalDtype`, cannot be used together with + If :class:`CategoricalDtype`, cannot be used together with `categories` or `ordered`. .. versionadded:: 0.24.0