From 12299636bb9a79860357860e27896cd884554921 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 3 Oct 2019 17:19:11 +0100 Subject: [PATCH 01/45] 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/45] 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/45] 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/45] 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/45] 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/45] 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/45] 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/45] 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/45] 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/45] 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/45] 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/45] 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/45] 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/45] 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/45] 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 From fb3690bf609707457efb414f8ca204610ab5e619 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 21:52:59 +0100 Subject: [PATCH 16/45] docstring fix for to_json method --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index fa269b4ebeab1..da8db23fb538b 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2353,7 +2353,7 @@ def to_json( .. versionadded:: 0.23.0 - indent : integer, optional + indent : int, optional Length of whitespace used to indent each record. .. versionadded:: 1.0.0 From 90f04c9fe2a5bc5a4a0d5e17b56935423153f502 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 21:54:15 +0100 Subject: [PATCH 17/45] docstring fix for unstack method --- pandas/core/frame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 5200ad0ba0d23..79e941f262931 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6238,7 +6238,7 @@ def unstack(self, level=-1, fill_value=None): ---------- level : int, str, or list of these, default -1 (last level) Level(s) of index to unstack, can pass level name. - fill_value : int, string or dict + fill_value : int, str or dict Replace NaN with this value if the unstack produces missing values. Returns From 4cf387e1fcbab3b16724231bae7ae2d730911865 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:00:21 +0100 Subject: [PATCH 18/45] docstring fix for nunique method --- pandas/core/groupby/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index 7be11696b7d45..068d5e5275f0d 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -1644,7 +1644,7 @@ def nunique(self, dropna=True): Parameters ---------- - dropna : boolean, default True + dropna : bool, default True Don't include NaN in the counts. Returns From e4bc5258ab58188f1879f9d80c56722ff924d048 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:03:52 +0100 Subject: [PATCH 19/45] docstring fix for indexer_at_time method --- pandas/core/indexes/datetimes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 0b20df38e7d42..6a2f49cd1470e 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -1328,7 +1328,7 @@ def indexer_at_time(self, time, asof=False): Parameters ---------- - time : datetime.time or string + time : datetime.time or str datetime.time or string in appropriate format ("%H:%M", "%H%M", "%I:%M%p", "%I%M%p", "%H:%M:%S", "%H%M%S", "%I:%M:%S%p", "%I%M%S%p"). From 817b73de01ad8dcd7752613ed745586d0a5cbf33 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:05:09 +0100 Subject: [PATCH 20/45] docstring fix for sortlevel method --- pandas/core/indexes/multi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 2007da541bb2e..8a098e7d632e6 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -2334,7 +2334,7 @@ def sortlevel(self, level=0, ascending=True, sort_remaining=True): level : list-like, int or str, default 0 If a string is given, must be a name of the level If list-like must be names or ints of levels. - ascending : boolean, default True + ascending : bool, default True False to sort in descending order Can also be a list to specify a directed ordering sort_remaining : sort by the remaining levels after level From 7f08a4be227c56eabb27f6b640b28190961f08e8 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:05:59 +0100 Subject: [PATCH 21/45] docstring fix for to_frame method --- pandas/core/indexes/multi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 8a098e7d632e6..596eaf0c55dbd 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -1650,7 +1650,7 @@ def to_frame(self, index=True, name=None): Parameters ---------- - index : boolean, default True + index : bool, default True Set the index of the returned DataFrame as the original MultiIndex. name : list / sequence of strings, optional From 3f8db1d18467f0cff13e80882c96dce8c6d2cf15 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:09:50 +0100 Subject: [PATCH 22/45] docstring fix for categoricalindex --- pandas/core/indexes/category.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/category.py b/pandas/core/indexes/category.py index ed3a4a7953df3..b538c4df00e19 100644 --- a/pandas/core/indexes/category.py +++ b/pandas/core/indexes/category.py @@ -77,7 +77,7 @@ class CategoricalIndex(Index, accessor.PandasDelegate): 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`. From 8bdcddfabb91746eae62880904b6ab47adf7fa0b Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:12:16 +0100 Subject: [PATCH 23/45] docstring fix for shift method --- pandas/core/indexes/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index c9c02ad9e496a..7dee3a17f8f9e 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -4531,7 +4531,7 @@ def shift(self, periods=1, freq=None): periods : int, default 1 Number of periods (or increments) to shift by, can be positive or negative. - freq : pandas.DateOffset, pandas.Timedelta or string, optional + freq : pandas.DateOffset, pandas.Timedelta or str, optional Frequency increment to shift by. If None, the index is shifted by its own `freq` attribute. Offset aliases are valid strings, e.g., 'D', 'W', 'M' etc. From c535f454386cff7e7d0eff04cb216e3b3a3228d8 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:13:48 +0100 Subject: [PATCH 24/45] docstring fix for eval method --- pandas/core/computation/eval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/computation/eval.py b/pandas/core/computation/eval.py index 8614230c4811f..a0af8811fef10 100644 --- a/pandas/core/computation/eval.py +++ b/pandas/core/computation/eval.py @@ -198,14 +198,14 @@ def eval( `__, only Python `expressions `__. - parser : string, default 'pandas', {'pandas', 'python'} + parser : str, default 'pandas', {'pandas', 'python'} The parser to use to construct the syntax tree from the expression. The default of ``'pandas'`` parses code slightly different than standard Python. Alternatively, you can parse an expression using the ``'python'`` parser to retain strict Python semantics. See the :ref:`enhancing performance ` documentation for more details. - engine : string or None, default 'numexpr', {'python', 'numexpr'} + engine : str or None, default 'numexpr', {'python', 'numexpr'} The engine used to evaluate the expression. Supported engines are From 9c43759d52229cce8b372e6c60b67b46ec87661c Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:20:55 +0100 Subject: [PATCH 25/45] docstring fix for interval_rangemethod --- pandas/core/indexes/interval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/indexes/interval.py b/pandas/core/indexes/interval.py index 2cc15f7650ac1..a2d48b5100a2e 100644 --- a/pandas/core/indexes/interval.py +++ b/pandas/core/indexes/interval.py @@ -1412,11 +1412,11 @@ def interval_range( Right bound for generating intervals periods : int, default None Number of periods to generate - freq : numeric, string, or DateOffset, default None + freq : numeric, str, or DateOffset, default None The length of each interval. Must be consistent with the type of start and end, e.g. 2 for numeric, or '5H' for datetime-like. Default is 1 for numeric and 'D' for datetime-like. - name : string, default None + name : str, default None Name of the resulting IntervalIndex closed : {'left', 'right', 'both', 'neither'}, default 'right' Whether the intervals are closed on the left-side, right-side, both From 452baf4763cf41c44242dd6ae7cf6fd2a027d2cd Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:22:33 +0100 Subject: [PATCH 26/45] docstring fix for infer_freq method --- pandas/tseries/frequencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tseries/frequencies.py b/pandas/tseries/frequencies.py index 4491e6ad9ac7e..0dcd8aeb4df9b 100644 --- a/pandas/tseries/frequencies.py +++ b/pandas/tseries/frequencies.py @@ -223,7 +223,7 @@ def infer_freq(index, warn=True): ---------- index : DatetimeIndex or TimedeltaIndex if passed a Series will use the values of the series (NOT THE INDEX) - warn : boolean, default True + warn : bool, default True Returns ------- From 46a83fc12e275da2e1410243a41f950060d58ed6 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:24:02 +0100 Subject: [PATCH 27/45] docstring fix for to_numeric method --- pandas/core/tools/numeric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index fa33d11bda7eb..d20483e06bab1 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -39,7 +39,7 @@ def to_numeric(arg, errors="raise", downcast=None): - If 'raise', then invalid parsing will raise an exception - If 'coerce', then invalid parsing will be set as NaN - If 'ignore', then invalid parsing will return the input - downcast : {'integer', 'signed', 'unsigned', 'float'} , default None + downcast : {'int', 'signed', 'unsigned', 'float'} , default None If not None, and if the data has been successfully cast to a numerical dtype (or if the data was numeric to begin with), downcast that resulting data to the smallest numerical dtype From 695350fbf5213be8976d69500b81c3284b18409c Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:28:29 +0100 Subject: [PATCH 28/45] docstring fix for qcut method --- pandas/core/reshape/tile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/reshape/tile.py b/pandas/core/reshape/tile.py index be5d75224e77d..a66b3ec5c9c02 100644 --- a/pandas/core/reshape/tile.py +++ b/pandas/core/reshape/tile.py @@ -285,10 +285,10 @@ def qcut(x, q, labels=None, retbins=False, precision=3, duplicates="raise"): Parameters ---------- x : 1d ndarray or Series - q : integer or array of quantiles + q : int or array of quantiles Number of quantiles. 10 for deciles, 4 for quartiles, etc. Alternately array of quantiles, e.g. [0, .25, .5, .75, 1.] for quartiles - labels : array or boolean, default None + 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 bins. From f6f3606de3caac08c36ef38f55465747cd02b9df Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:39:40 +0100 Subject: [PATCH 29/45] docstring fix for readstata --- pandas/io/stata.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/io/stata.py b/pandas/io/stata.py index 0b674b556b2ee..ef193e1201619 100644 --- a/pandas/io/stata.py +++ b/pandas/io/stata.py @@ -53,9 +53,9 @@ ) _statafile_processing_params1 = """\ -convert_dates : boolean, defaults to True +convert_dates : bool, defaults to True Convert date variables to DataFrame time values. -convert_categoricals : boolean, defaults to True +convert_categoricals : bool, defaults to True Read value labels and convert columns to Categorical/Factor variables.""" _encoding_params = """\ @@ -65,19 +65,19 @@ _statafile_processing_params2 = """\ index_col : string, optional, default: None Column to set as index. -convert_missing : boolean, defaults to False +convert_missing : bool, defaults to False Flag indicating whether to convert missing values to their Stata representations. If False, missing values are replaced with nan. If True, columns containing missing values are returned with object data types and missing values are represented by StataMissingValue objects. -preserve_dtypes : boolean, defaults to True +preserve_dtypes : bool, defaults to True Preserve Stata datatypes. If False, numeric data are upcast to pandas default types for foreign data (float64 or int64). columns : list or None Columns to retain. Columns will be returned in the given order. None returns all columns. -order_categoricals : boolean, defaults to True +order_categoricals : bool, defaults to True Flag indicating whether converted categorical data are ordered.""" _chunksize_params = """\ From ef33f1d27543344595f2d87a013f8b1ba37d7b9d Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:46:41 +0100 Subject: [PATCH 30/45] docstring fix for readstata --- pandas/io/stata.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/io/stata.py b/pandas/io/stata.py index ef193e1201619..9849828919fd3 100644 --- a/pandas/io/stata.py +++ b/pandas/io/stata.py @@ -59,11 +59,11 @@ Read value labels and convert columns to Categorical/Factor variables.""" _encoding_params = """\ -encoding : string, None or encoding +encoding : str, None or encoding Encoding used to parse the files. None defaults to latin-1.""" _statafile_processing_params2 = """\ -index_col : string, optional, default: None +index_col : str, optional, default: None Column to set as index. convert_missing : bool, defaults to False Flag indicating whether to convert missing values to their Stata @@ -86,7 +86,7 @@ given number of lines.""" _iterator_params = """\ -iterator : boolean, default False +iterator : bool, default False Return StataReader object.""" _read_stata_doc = """ From 03f6a8848e22f26e5bf21a12a7cee8cef7541aec Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:49:56 +0100 Subject: [PATCH 31/45] docstring fix for hdfstore.append --- pandas/io/pytables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 0db5b1b4eecfa..ad29d7280eae4 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1025,7 +1025,7 @@ def append( Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching / selecting subsets of the data - append : boolean, default True, append the input data to the + append : bool, default True, append the input data to the existing data_columns : list of columns, or True, default None List of columns to create as indexed data columns for on-disk @@ -1037,7 +1037,7 @@ def append( chunksize : size to chunk the writing expectedrows : expected TOTAL row size of this table encoding : default None, provide an encoding for strings - dropna : boolean, default False, do not write an ALL nan row to + dropna : bool, default False, do not write an ALL nan row to the store settable by the option 'io.hdf.dropna_table' Notes From 2836eaeb84914c1b62b7af0f16dc6b0d194f63bf Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:52:00 +0100 Subject: [PATCH 32/45] docstring fix for read_sql --- pandas/io/sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/sql.py b/pandas/io/sql.py index b0683fb8b0dfb..822b3288c82d9 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -287,7 +287,7 @@ def read_sql_query( If a DBAPI2 object, only sqlite3 is supported. index_col : string or list of strings, optional, default: None Column(s) to set as index(MultiIndex). - coerce_float : boolean, default True + coerce_float : bool, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. Useful for SQL result sets. params : list, tuple or dict, optional, default: None From 4e46f718a3a8b0e81195c7e943065b463780a5a7 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 22:58:59 +0100 Subject: [PATCH 33/45] docstring fix for read_csv and read_table --- pandas/io/parsers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index 3678e32943b2e..c82486532530f 100755 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -257,7 +257,7 @@ arguments. dayfirst : bool, default False DD/MM format dates, international and European format. -cache_dates : boolean, default True +cache_dates : bool, default True If True, use a cache of unique, converted dates to apply the datetime conversion. May produce significant speed-up when parsing duplicate date strings, especially ones with timezone offsets. From 724d8870d2123593392f6ade74913fb1ad2fa486 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sat, 12 Oct 2019 23:01:26 +0100 Subject: [PATCH 34/45] docstring fix for read_json --- pandas/io/json/_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 6ce288890b6c7..4031502b623f9 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -384,7 +384,7 @@ def read_json( By file-like object, we refer to objects with a ``read()`` method, such as a file handler (e.g. via builtin ``open`` function) or ``StringIO``. - orient : string, + orient : str, Indication of expected JSON string format. Compatible JSON strings can be produced by ``to_json()`` with a corresponding orient value. From 6b3706badf4c1bf0ca8798525358b414ef3bc2d8 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 13 Oct 2019 11:15:51 +0100 Subject: [PATCH 35/45] eval.py docs updated --- pandas/core/computation/eval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/computation/eval.py b/pandas/core/computation/eval.py index a0af8811fef10..44ad6970aefd4 100644 --- a/pandas/core/computation/eval.py +++ b/pandas/core/computation/eval.py @@ -198,7 +198,7 @@ def eval( `__, only Python `expressions `__. - parser : str, default 'pandas', {'pandas', 'python'} + parser : {'pandas', 'python'}, default 'pandas' The parser to use to construct the syntax tree from the expression. The default of ``'pandas'`` parses code slightly different than standard Python. Alternatively, you can parse an expression using the From 84edcb4e41d66f8e3bae77204c72383c7cc62624 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 13 Oct 2019 11:17:27 +0100 Subject: [PATCH 36/45] eval.py docs for engine updated --- pandas/core/computation/eval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/computation/eval.py b/pandas/core/computation/eval.py index 44ad6970aefd4..25da214aa48fd 100644 --- a/pandas/core/computation/eval.py +++ b/pandas/core/computation/eval.py @@ -205,7 +205,7 @@ def eval( ``'python'`` parser to retain strict Python semantics. See the :ref:`enhancing performance ` documentation for more details. - engine : str or None, default 'numexpr', {'python', 'numexpr'} + engine : {'python', 'numexpr'}, optional, default 'numexpr' The engine used to evaluate the expression. Supported engines are From b3b9407c646f281a5b41b00dbc7d61633cb62592 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 13 Oct 2019 11:27:56 +0100 Subject: [PATCH 37/45] to_numeric.py docs updated --- pandas/core/tools/numeric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index d20483e06bab1..05696ffd4605d 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -39,7 +39,7 @@ def to_numeric(arg, errors="raise", downcast=None): - If 'raise', then invalid parsing will raise an exception - If 'coerce', then invalid parsing will be set as NaN - If 'ignore', then invalid parsing will return the input - downcast : {'int', 'signed', 'unsigned', 'float'} , default None + downcast : {'integer', 'signed', 'unsigned', 'float'}, default None If not None, and if the data has been successfully cast to a numerical dtype (or if the data was numeric to begin with), downcast that resulting data to the smallest numerical dtype From 06559f70c501cd24b9e146043138555f965180fe Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 13 Oct 2019 11:30:10 +0100 Subject: [PATCH 38/45] append.py docs for append updated --- pandas/io/pytables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index ad29d7280eae4..1829db322e44b 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1025,8 +1025,8 @@ def append( Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching / selecting subsets of the data - append : bool, default True, append the input data to the - existing + append : bool, default True, + append the input data to the existing data_columns : list of columns, or True, default None List of columns to create as indexed data columns for on-disk queries, or True to use all columns. By default only the axes From 79dfacb237cd81cdee512fbaa529fc4275ea58f8 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 13 Oct 2019 11:31:39 +0100 Subject: [PATCH 39/45] append.py docs for dropna updated --- pandas/io/pytables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 1829db322e44b..b7795d6d68fa1 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1037,8 +1037,8 @@ def append( chunksize : size to chunk the writing expectedrows : expected TOTAL row size of this table encoding : default None, provide an encoding for strings - dropna : bool, default False, do not write an ALL nan row to - the store settable by the option 'io.hdf.dropna_table' + dropna : bool, default False, + do not write an ALL nan row to the store settable by the option 'io.hdf.dropna_table' Notes ----- From dcf751578d2af92e99f4721ed92f17e30be5d373 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 13 Oct 2019 11:34:19 +0100 Subject: [PATCH 40/45] stata.py docs updated --- pandas/io/stata.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pandas/io/stata.py b/pandas/io/stata.py index 9849828919fd3..679b74caba79e 100644 --- a/pandas/io/stata.py +++ b/pandas/io/stata.py @@ -53,9 +53,9 @@ ) _statafile_processing_params1 = """\ -convert_dates : bool, defaults to True +convert_dates : bool, default True Convert date variables to DataFrame time values. -convert_categoricals : bool, defaults to True +convert_categoricals : bool, default True Read value labels and convert columns to Categorical/Factor variables.""" _encoding_params = """\ @@ -63,21 +63,21 @@ Encoding used to parse the files. None defaults to latin-1.""" _statafile_processing_params2 = """\ -index_col : str, optional, default: None +index_col : str, optional Column to set as index. -convert_missing : bool, defaults to False +convert_missing : bool, default False Flag indicating whether to convert missing values to their Stata representations. If False, missing values are replaced with nan. If True, columns containing missing values are returned with object data types and missing values are represented by StataMissingValue objects. -preserve_dtypes : bool, defaults to True +preserve_dtypes : bool, default True Preserve Stata datatypes. If False, numeric data are upcast to pandas default types for foreign data (float64 or int64). columns : list or None Columns to retain. Columns will be returned in the given order. None returns all columns. -order_categoricals : bool, defaults to True +order_categoricals : bool, default True Flag indicating whether converted categorical data are ordered.""" _chunksize_params = """\ From 55ff7900e49baeb1426c2a54916944ae93745f4e Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 13 Oct 2019 11:38:25 +0100 Subject: [PATCH 41/45] pep8 fix --- pandas/io/pytables.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index b7795d6d68fa1..caadde5b77fca 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1038,7 +1038,8 @@ def append( expectedrows : expected TOTAL row size of this table encoding : default None, provide an encoding for strings dropna : bool, default False, - do not write an ALL nan row to the store settable by the option 'io.hdf.dropna_table' + do not write an ALL nan row to the store settable + by the option 'io.hdf.dropna_table' Notes ----- From c110b5a780ca2f902e337dce7e2f567be9b9e496 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 13 Oct 2019 18:43:48 +0100 Subject: [PATCH 42/45] remove optional from eval.py docstring --- pandas/core/computation/eval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/computation/eval.py b/pandas/core/computation/eval.py index 25da214aa48fd..63344af63470f 100644 --- a/pandas/core/computation/eval.py +++ b/pandas/core/computation/eval.py @@ -205,7 +205,7 @@ def eval( ``'python'`` parser to retain strict Python semantics. See the :ref:`enhancing performance ` documentation for more details. - engine : {'python', 'numexpr'}, optional, default 'numexpr' + engine : {'python', 'numexpr'}, default 'numexpr' The engine used to evaluate the expression. Supported engines are From 466b179a8083a668b30b977a700d64996cf006c5 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 13 Oct 2019 18:45:25 +0100 Subject: [PATCH 43/45] updating docstring for qcut method --- 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 a66b3ec5c9c02..6942a5797a7f0 100644 --- a/pandas/core/reshape/tile.py +++ b/pandas/core/reshape/tile.py @@ -285,7 +285,7 @@ def qcut(x, q, labels=None, retbins=False, precision=3, duplicates="raise"): Parameters ---------- x : 1d ndarray or Series - q : int or array of quantiles + 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 labels : array or bool, default None From b9193f80a43369965c44e9ed3e475ba57d5f217a Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 13 Oct 2019 18:46:14 +0100 Subject: [PATCH 44/45] remove comma from read_json --- pandas/io/json/_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 4031502b623f9..c71677fa3b570 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -384,7 +384,7 @@ def read_json( By file-like object, we refer to objects with a ``read()`` method, such as a file handler (e.g. via builtin ``open`` function) or ``StringIO``. - orient : str, + orient : str Indication of expected JSON string format. Compatible JSON strings can be produced by ``to_json()`` with a corresponding orient value. From 4c391d65912565ff6110032b1eebbd3e79a3aeb3 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 13 Oct 2019 18:48:54 +0100 Subject: [PATCH 45/45] updating docs for append method --- pandas/io/pytables.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index caadde5b77fca..c87cad5472bd9 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1025,8 +1025,8 @@ def append( Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching / selecting subsets of the data - append : bool, default True, - append the input data to the existing + append : bool, default True + Append the input data to the existing. data_columns : list of columns, or True, default None List of columns to create as indexed data columns for on-disk queries, or True to use all columns. By default only the axes @@ -1037,9 +1037,9 @@ def append( chunksize : size to chunk the writing expectedrows : expected TOTAL row size of this table encoding : default None, provide an encoding for strings - dropna : bool, default False, - do not write an ALL nan row to the store settable - by the option 'io.hdf.dropna_table' + dropna : bool, default False + Do not write an ALL nan row to the store settable + by the option 'io.hdf.dropna_table'. Notes -----