From 1bed14057472aa0716d3acac98bc28d3927fbe78 Mon Sep 17 00:00:00 2001 From: Samyak Jain Date: Thu, 3 Oct 2019 02:39:51 +0530 Subject: [PATCH 1/4] DOC: Fixed PR06 docstring errors in pandas.interval_range DOC: Fixed PR06 docstring errors in pandas.interval_range --- pandas/core/indexes/interval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/interval.py b/pandas/core/indexes/interval.py index 29e297cb28a3b..2cc15f7650ac1 100644 --- a/pandas/core/indexes/interval.py +++ b/pandas/core/indexes/interval.py @@ -1410,7 +1410,7 @@ def interval_range( Left bound for generating intervals end : numeric or datetime-like, default None Right bound for generating intervals - periods : integer, default None + periods : int, default None Number of periods to generate freq : numeric, string, or DateOffset, default None The length of each interval. Must be consistent with the type of start From 01986968774dc9e9ecb70a4a8bf284bde9c0b6b9 Mon Sep 17 00:00:00 2001 From: Samyak Jain Date: Thu, 3 Oct 2019 02:57:36 +0530 Subject: [PATCH 2/4] DOC: Fixed PR06 docstring errors in pandas.util.hash_array DOC: Fixed PR06 docstring errors in pandas.util.hash_array --- pandas/core/util/hashing.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pandas/core/util/hashing.py b/pandas/core/util/hashing.py index bcdbf0855cbb4..343314d0ecc79 100644 --- a/pandas/core/util/hashing.py +++ b/pandas/core/util/hashing.py @@ -62,11 +62,11 @@ def hash_pandas_object( Parameters ---------- - index : boolean, default True + index : bool, default True include the index in the hash (if Series/DataFrame) - encoding : string, default 'utf8' - encoding for data & key when strings - hash_key : string key to encode, default to _default_hash_key + encoding : str, default 'utf8' + encoding for data & key when str + hash_key : str key to encode, default to _default_hash_key categorize : bool, default True Whether to first categorize object arrays before hashing. This is more efficient when the array contains duplicate values. @@ -143,8 +143,8 @@ def hash_tuples(vals, encoding="utf8", hash_key=None): Parameters ---------- vals : MultiIndex, list-of-tuples, or single tuple - encoding : string, default 'utf8' - hash_key : string key to encode, default to _default_hash_key + encoding : str, default 'utf8' + hash_key : str key to encode, default to _default_hash_key Returns ------- @@ -186,8 +186,8 @@ def hash_tuple(val, encoding="utf8", hash_key=None): Parameters ---------- val : single tuple - encoding : string, default 'utf8' - hash_key : string key to encode, default to _default_hash_key + encoding : str, default 'utf8' + hash_key : str key to encode, default to _default_hash_key Returns ------- @@ -209,8 +209,8 @@ def _hash_categorical(c, encoding, hash_key): Parameters ---------- c : Categorical - encoding : string, default 'utf8' - hash_key : string key to encode, default to _default_hash_key + encoding : str, default 'utf8' + hash_key : str key to encode, default to _default_hash_key Returns ------- @@ -246,9 +246,9 @@ def hash_array(vals, encoding="utf8", hash_key=None, categorize=True): Parameters ---------- vals : ndarray, Categorical - encoding : string, default 'utf8' - encoding for data & key when strings - hash_key : string key to encode, default to _default_hash_key + encoding : str, default 'utf8' + encoding for data & key when str + hash_key : str key to encode, default to _default_hash_key categorize : bool, default True Whether to first categorize object arrays before hashing. This is more efficient when the array contains duplicate values. @@ -338,7 +338,7 @@ def _hash_scalar(val, encoding="utf8", hash_key=None): val = tslibs.Timestamp(val) val = val.tz_convert(None) - dtype, val = infer_dtype_from_scalar(val) + dtype, val = infer_dtype_from_scalar(val)boo vals = np.array([val], dtype=dtype) return hash_array(vals, hash_key=hash_key, encoding=encoding, categorize=False) From 4191976ae1ef2ff76d3fcc83ebf83e52d3f5ad3f Mon Sep 17 00:00:00 2001 From: Samyak Jain Date: Thu, 3 Oct 2019 03:12:10 +0530 Subject: [PATCH 3/4] Corrects hashing.py --- pandas/core/util/hashing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/util/hashing.py b/pandas/core/util/hashing.py index 343314d0ecc79..2733feed544cf 100644 --- a/pandas/core/util/hashing.py +++ b/pandas/core/util/hashing.py @@ -338,7 +338,7 @@ def _hash_scalar(val, encoding="utf8", hash_key=None): val = tslibs.Timestamp(val) val = val.tz_convert(None) - dtype, val = infer_dtype_from_scalar(val)boo + dtype, val = infer_dtype_from_scalar(val) vals = np.array([val], dtype=dtype) return hash_array(vals, hash_key=hash_key, encoding=encoding, categorize=False) From 5367b6dddfb0742c1790c4ae61b76a44583430cc Mon Sep 17 00:00:00 2001 From: Samyak Jain Date: Thu, 3 Oct 2019 19:49:56 +0530 Subject: [PATCH 4/4] Updates hashing.py --- pandas/core/util/hashing.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pandas/core/util/hashing.py b/pandas/core/util/hashing.py index 2733feed544cf..770786db658bf 100644 --- a/pandas/core/util/hashing.py +++ b/pandas/core/util/hashing.py @@ -65,8 +65,9 @@ def hash_pandas_object( index : bool, default True include the index in the hash (if Series/DataFrame) encoding : str, default 'utf8' - encoding for data & key when str - hash_key : str key to encode, default to _default_hash_key + encoding for data & key when strings + hash_key : str, default '_default_hash_key' + hash_key for string key to encode categorize : bool, default True Whether to first categorize object arrays before hashing. This is more efficient when the array contains duplicate values. @@ -144,7 +145,7 @@ def hash_tuples(vals, encoding="utf8", hash_key=None): ---------- vals : MultiIndex, list-of-tuples, or single tuple encoding : str, default 'utf8' - hash_key : str key to encode, default to _default_hash_key + hash_key : str, default '_default_hash_key' Returns ------- @@ -187,7 +188,7 @@ def hash_tuple(val, encoding="utf8", hash_key=None): ---------- val : single tuple encoding : str, default 'utf8' - hash_key : str key to encode, default to _default_hash_key + hash_key : str, default '_default_hash_key' Returns ------- @@ -210,7 +211,7 @@ def _hash_categorical(c, encoding, hash_key): ---------- c : Categorical encoding : str, default 'utf8' - hash_key : str key to encode, default to _default_hash_key + hash_key : str, default '_default_hash_key' Returns ------- @@ -247,8 +248,9 @@ def hash_array(vals, encoding="utf8", hash_key=None, categorize=True): ---------- vals : ndarray, Categorical encoding : str, default 'utf8' - encoding for data & key when str - hash_key : str key to encode, default to _default_hash_key + encoding for data & key when strings + hash_key : str, default '_default_hash_key' + hash_key for string key to encode categorize : bool, default True Whether to first categorize object arrays before hashing. This is more efficient when the array contains duplicate values.