From 9dc330c38a2dd574a74b2da0d6611cd343734fff Mon Sep 17 00:00:00 2001 From: hughkelley Date: Fri, 1 Nov 2019 18:28:16 +0000 Subject: [PATCH 01/11] add periods to descriptions in Multiindex and DateTimeIndex --- pandas/core/indexes/datetimes.py | 12 ++++++------ pandas/core/indexes/multi.py | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index ee2f4e0f1e85d..e5cecd090e061 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -103,13 +103,13 @@ class DatetimeIndex(DatetimeIndexOpsMixin, Int64Index, DatetimeDelegateMixin): Parameters ---------- data : array-like (1-dimensional), optional - Optional datetime-like data to construct index with + Optional datetime-like data to construct index with. copy : bool - Make a copy of input ndarray + Make a copy of input ndarray. freq : str or pandas offset object, optional One of pandas date offset strings or corresponding objects. The string 'infer' can be passed in order to set the frequency of the index as the - inferred frequency upon creation + inferred frequency upon creation. start : starting value, datetime-like, optional If data is None, start is used as the start point in generating regular @@ -119,19 +119,19 @@ class DatetimeIndex(DatetimeIndexOpsMixin, Int64Index, DatetimeDelegateMixin): periods : int, optional, > 0 Number of periods to generate, if generating index. Takes precedence - over end argument + over end argument. .. deprecated:: 0.24.0 end : end time, datetime-like, optional If periods is none, generated index will extend to first conforming - time on or just past end argument + time on or just past end argument. .. deprecated:: 0.24.0 closed : str or None, default None Make the interval closed with respect to the given frequency to - the 'left', 'right', or both sides (None) + the 'left', 'right', or both sides (None). .. deprecated:: 0.24. 0 diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index dc2abfb0cb6eb..c99e42e48c346 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -882,13 +882,13 @@ def set_codes(self, codes, level=None, inplace=False, verify_integrity=True): Parameters ---------- codes : sequence or list of sequence - new codes to apply + New codes 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 ------- @@ -1717,7 +1717,7 @@ def to_hierarchical(self, n_repeat, n_shuffle=1): Parameters ---------- n_repeat : int - Number of times to repeat the labels on self + Number of times to repeat the labels on self. n_shuffle : int Controls the reordering of the labels. If the result is going to be an inner level in a MultiIndex, n_shuffle will need to be @@ -2335,11 +2335,11 @@ def sortlevel(self, level=0, ascending=True, sort_remaining=True): Parameters ---------- level : list-like, int or str, default 0 - If a string is given, must be a name of the level + If a string is given, must be a name of the level. If list-like must be names or ints of levels. ascending : bool, default True - False to sort in descending order - Can also be a list to specify a directed ordering + 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 Returns From da445326bfd36815d44272197bc45eff097f4ed3 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Fri, 1 Nov 2019 18:35:17 +0000 Subject: [PATCH 02/11] fix PR09 in sql.py --- pandas/io/sql.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/io/sql.py b/pandas/io/sql.py index 820aeaeb11649..e90e19649f645 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -294,7 +294,7 @@ def read_sql_query( to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249's paramstyle, is supported. - Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'} + Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'}. parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is @@ -372,7 +372,7 @@ def read_sql( to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249's paramstyle, is supported. - Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'} + Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'}. parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is From fffb41e383cb2c5dbf4bcefa02ca24dd3df9322e Mon Sep 17 00:00:00 2001 From: hughkelley Date: Fri, 1 Nov 2019 18:36:57 +0000 Subject: [PATCH 03/11] fix PR09 in spss.py --- pandas/io/spss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/spss.py b/pandas/io/spss.py index 4f13349a819c3..cf682ec72f284 100644 --- a/pandas/io/spss.py +++ b/pandas/io/spss.py @@ -20,7 +20,7 @@ def read_spss( Parameters ---------- path : string or Path - File path + File path. usecols : list-like, optional Return a subset of the columns. If None, return all columns. convert_categoricals : bool, default is True From f36ae1b5aac8cdd7208414f0a873f76d60f89bbd Mon Sep 17 00:00:00 2001 From: hughkelley Date: Fri, 1 Nov 2019 18:38:54 +0000 Subject: [PATCH 04/11] PR09 in HDFStore.append --- pandas/io/pytables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 94f863d8970f1..35e6d53127e59 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1024,7 +1024,7 @@ def append( table(t) : table format Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching - / selecting subsets of the data + / selecting subsets of the data. append : bool, default True Append the input data to the existing. data_columns : list of columns, or True, default None From 3da3af3be589918014b176ba3c768b03f9637ff1 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Fri, 1 Nov 2019 18:41:03 +0000 Subject: [PATCH 05/11] PR09 in ExcelWriter --- pandas/io/excel/_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 8574c9ad1d425..1f1ad55969d6f 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -552,9 +552,9 @@ class ExcelWriter(metaclass=abc.ABCMeta): ``io.excel..writer``. NOTE: can only be passed as a keyword argument. date_format : str, default None - Format string for dates written into Excel files (e.g. 'YYYY-MM-DD') + Format string for dates written into Excel files (e.g. 'YYYY-MM-DD'). datetime_format : str, default None - Format string for datetime objects written into Excel files + Format string for datetime objects written into Excel files. (e.g. 'YYYY-MM-DD HH:MM:SS') mode : {'w', 'a'}, default 'w' File mode to use (write or append). From ccc3a305acfb7accaa9af9fcd18f32865ad5ec30 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Fri, 1 Nov 2019 18:43:07 +0000 Subject: [PATCH 06/11] PR09 in pandas.infer_freq --- 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 0dcd8aeb4df9b..beeef3811ae5d 100644 --- a/pandas/tseries/frequencies.py +++ b/pandas/tseries/frequencies.py @@ -222,7 +222,7 @@ def infer_freq(index, warn=True): Parameters ---------- index : DatetimeIndex or TimedeltaIndex - if passed a Series will use the values of the series (NOT THE INDEX) + if passed a Series will use the values of the series (NOT THE INDEX). warn : bool, default True Returns From 25aa9a51265da5573aca7ef9a1e556c8ae4cbcc0 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Fri, 1 Nov 2019 18:46:33 +0000 Subject: [PATCH 07/11] PR09 in eval.py --- 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 430daa4708001..461561a80a7e5 100644 --- a/pandas/core/computation/eval.py +++ b/pandas/core/computation/eval.py @@ -219,7 +219,7 @@ def eval( More backends may be available in the future. truediv : bool, optional - Whether to use true division, like in Python >= 3 + Whether to use true division, like in Python >= 3. local_dict : dict or None, optional A dictionary of local variables, taken from locals() by default. global_dict : dict or None, optional From d950c1344eb6c384ef34d93a3fe6ff45dd4123ee Mon Sep 17 00:00:00 2001 From: hughkelley Date: Fri, 1 Nov 2019 18:48:41 +0000 Subject: [PATCH 08/11] PR09 in to_numeric --- pandas/core/tools/numeric.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index 05696ffd4605d..e59ed247bd87b 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -36,9 +36,9 @@ def to_numeric(arg, errors="raise", downcast=None): ---------- arg : scalar, list, tuple, 1-d array, or Series errors : {'ignore', 'raise', 'coerce'}, default 'raise' - - 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 + - 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 If not None, and if the data has been successfully cast to a numerical dtype (or if the data was numeric to begin with), From e65ded189dfa1451a9f7ebfdb9cd6f077b5a8476 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Fri, 1 Nov 2019 18:50:15 +0000 Subject: [PATCH 09/11] PR09 in merge_asof --- pandas/core/reshape/merge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/reshape/merge.py b/pandas/core/reshape/merge.py index 7e593ddb91d3a..ea334503a4302 100644 --- a/pandas/core/reshape/merge.py +++ b/pandas/core/reshape/merge.py @@ -359,7 +359,7 @@ def merge_asof( - If True, allow matching with the same 'on' value (i.e. less-than-or-equal-to / greater-than-or-equal-to) - If False, don't match the same 'on' value - (i.e., strictly less-than / strictly greater-than) + (i.e., strictly less-than / strictly greater-than). direction : 'backward' (default), 'forward', or 'nearest' Whether to search for prior, subsequent, or closest matches. From 2710eb85a22bd51a74abd4d7a2a701e3c6f41e61 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Fri, 1 Nov 2019 18:51:40 +0000 Subject: [PATCH 10/11] PR09 in qcut --- 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 2cc9f8927effb..24117e1999bf1 100644 --- a/pandas/core/reshape/tile.py +++ b/pandas/core/reshape/tile.py @@ -288,7 +288,7 @@ def qcut(x, q, labels=None, retbins=False, precision=3, duplicates="raise"): 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 + 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. @@ -296,7 +296,7 @@ def qcut(x, q, labels=None, retbins=False, precision=3, duplicates="raise"): Whether to return the (bins, labels) or not. Can be useful if bins is given as a scalar. precision : int, optional - The precision at which to store and display the bins labels + The precision at which to store and display the bins labels. duplicates : {default 'raise', 'drop'}, optional If bin edges are not unique, raise ValueError or drop non-uniques. From 1882acfd0fc8776dc69df1605dc92b735f9332e8 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Fri, 1 Nov 2019 19:42:33 +0000 Subject: [PATCH 11/11] remove extra period --- 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 24117e1999bf1..a902c63e20e7d 100644 --- a/pandas/core/reshape/tile.py +++ b/pandas/core/reshape/tile.py @@ -288,7 +288,7 @@ def qcut(x, q, labels=None, retbins=False, precision=3, duplicates="raise"): 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. + 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.