From 7e7d33e488ef407fcf5c09636465bb1fff203345 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Mon, 25 Nov 2019 17:31:32 -0800 Subject: [PATCH 1/3] REF: implement core.algos --- pandas/core/algos/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 pandas/core/algos/__init__.py diff --git a/pandas/core/algos/__init__.py b/pandas/core/algos/__init__.py new file mode 100644 index 0000000000000..e66587ab2a199 --- /dev/null +++ b/pandas/core/algos/__init__.py @@ -0,0 +1,4 @@ +""" +core.algos is intended for algorithm implementations that operate on ndarrays +and ExtensionArrays, independent of the Index, Series, and DataFrame machinery. +""" From 1619c0226ab0387a22a636245768e998ccd39a46 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Tue, 10 Mar 2020 15:16:01 -0700 Subject: [PATCH 2/3] CLN: avoid runtime import of Index --- pandas/core/algorithms.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index f9059054ba59f..348769f5d3964 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -2021,9 +2021,7 @@ def sort_mixed(values): ) codes = ensure_platform_int(np.asarray(codes)) - from pandas import Index - - if not assume_unique and not Index(values).is_unique: + if not assume_unique and not len(unique(values)) == len(values): raise ValueError("values should be unique if codes is not None") if sorter is None: From fdd335a5ce5d1721858c863c16a020429b3b985c Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Sat, 14 Mar 2020 16:59:03 -0700 Subject: [PATCH 3/3] revert --- pandas/core/algos/__init__.py | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 pandas/core/algos/__init__.py diff --git a/pandas/core/algos/__init__.py b/pandas/core/algos/__init__.py deleted file mode 100644 index e66587ab2a199..0000000000000 --- a/pandas/core/algos/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -""" -core.algos is intended for algorithm implementations that operate on ndarrays -and ExtensionArrays, independent of the Index, Series, and DataFrame machinery. -"""