Skip to content

Commit fffa72e

Browse files
jbrockmendelSeeminSyed
authored andcommitted
REF: avoid runtime import of Index (pandas-dev#32710)
1 parent 84786b9 commit fffa72e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pandas/core/algorithms.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,9 +2025,7 @@ def sort_mixed(values):
20252025
)
20262026
codes = ensure_platform_int(np.asarray(codes))
20272027

2028-
from pandas import Index
2029-
2030-
if not assume_unique and not Index(values).is_unique:
2028+
if not assume_unique and not len(unique(values)) == len(values):
20312029
raise ValueError("values should be unique if codes is not None")
20322030

20332031
if sorter is None:

0 commit comments

Comments
 (0)