From 4bf76e10d09f3d9ac16775274b62e02041b474f6 Mon Sep 17 00:00:00 2001 From: Farhan Reynaldo Date: Sun, 22 Mar 2020 11:45:03 +0700 Subject: [PATCH 1/3] DOC: Fix EX02 in pandas.Series.factorize --- pandas/core/algorithms.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 5b324bc5753ec..8735121f704d2 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -556,7 +556,7 @@ def factorize( >>> codes, uniques = pd.factorize(['b', 'b', 'a', 'c', 'b']) >>> codes - array([0, 0, 1, 2, 0]) + array([0, 0, 1, 2, 0], dtype=int64) >>> uniques array(['b', 'a', 'c'], dtype=object) @@ -565,7 +565,7 @@ def factorize( >>> codes, uniques = pd.factorize(['b', 'b', 'a', 'c', 'b'], sort=True) >>> codes - array([1, 1, 0, 2, 1]) + array([1, 1, 0, 2, 1], dtype=int64) >>> uniques array(['a', 'b', 'c'], dtype=object) @@ -575,7 +575,7 @@ def factorize( >>> codes, uniques = pd.factorize(['b', None, 'a', 'c', 'b']) >>> codes - array([ 0, -1, 1, 2, 0]) + array([ 0, -1, 1, 2, 0], dtype=int64) >>> uniques array(['b', 'a', 'c'], dtype=object) @@ -586,7 +586,7 @@ def factorize( >>> cat = pd.Categorical(['a', 'a', 'c'], categories=['a', 'b', 'c']) >>> codes, uniques = pd.factorize(cat) >>> codes - array([0, 0, 1]) + array([0, 0, 1], dtype=int64) >>> uniques [a, c] Categories (3, object): [a, b, c] @@ -600,7 +600,7 @@ def factorize( >>> cat = pd.Series(['a', 'a', 'c']) >>> codes, uniques = pd.factorize(cat) >>> codes - array([0, 0, 1]) + array([0, 0, 1], dtype=int64) >>> uniques Index(['a', 'c'], dtype='object') """ From 9fbe8458ba01b866977e130f05619a466c2fa7e5 Mon Sep 17 00:00:00 2001 From: Farhan Reynaldo Date: Wed, 1 Apr 2020 10:07:58 +0700 Subject: [PATCH 2/3] Add ellipsis to doctest option flags --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 87802190ea26a..fda4ba4065e2f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -60,7 +60,7 @@ markers = db: tests requiring a database (mysql or postgres) high_memory: mark a test as a high-memory only clipboard: mark a pd.read_clipboard test -doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL +doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS addopts = --strict-data-files xfail_strict = True filterwarnings = From b842c87e103be9a7038da7f7548642a37e3ec9eb Mon Sep 17 00:00:00 2001 From: Farhan Reynaldo Date: Wed, 1 Apr 2020 10:13:35 +0700 Subject: [PATCH 3/3] array type output to ellipsis --- pandas/core/algorithms.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 8597e3fd0c819..d04fc6cb2c1d4 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -556,7 +556,7 @@ def factorize( >>> codes, uniques = pd.factorize(['b', 'b', 'a', 'c', 'b']) >>> codes - array([0, 0, 1, 2, 0], dtype=int64) + array([0, 0, 1, 2, 0]...) >>> uniques array(['b', 'a', 'c'], dtype=object) @@ -565,7 +565,7 @@ def factorize( >>> codes, uniques = pd.factorize(['b', 'b', 'a', 'c', 'b'], sort=True) >>> codes - array([1, 1, 0, 2, 1], dtype=int64) + array([1, 1, 0, 2, 1]...) >>> uniques array(['a', 'b', 'c'], dtype=object) @@ -575,7 +575,7 @@ def factorize( >>> codes, uniques = pd.factorize(['b', None, 'a', 'c', 'b']) >>> codes - array([ 0, -1, 1, 2, 0], dtype=int64) + array([ 0, -1, 1, 2, 0]...) >>> uniques array(['b', 'a', 'c'], dtype=object) @@ -586,7 +586,7 @@ def factorize( >>> cat = pd.Categorical(['a', 'a', 'c'], categories=['a', 'b', 'c']) >>> codes, uniques = pd.factorize(cat) >>> codes - array([0, 0, 1], dtype=int64) + array([0, 0, 1]...) >>> uniques [a, c] Categories (3, object): [a, b, c] @@ -600,7 +600,7 @@ def factorize( >>> cat = pd.Series(['a', 'a', 'c']) >>> codes, uniques = pd.factorize(cat) >>> codes - array([0, 0, 1], dtype=int64) + array([0, 0, 1]...) >>> uniques Index(['a', 'c'], dtype='object') """