Skip to content

Commit d92c597

Browse files
committed
Avoid second coding, now that we respect order for unordered
1 parent e3183fb commit d92c597

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

pandas/core/categorical.py

-7
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,7 @@ def __init__(self, values, categories=None, ordered=False, fastpath=False):
312312
raise NotImplementedError("> 1 ndim Categorical are not "
313313
"supported at this time")
314314

315-
# categories = self.dtype._validate_categories(categories)
316315
dtype = CategoricalDtype(categories, ordered)
317-
# XXX: would like to avoid this second coding
318-
# could do something like unique() instead of factorize?
319-
# will still be slower though.
320-
# Issue is if there already exists a CategoricalDtype with
321-
# `categories`, then the codes might not match up.
322-
codes = _get_codes_for_values(values, dtype.categories)
323316

324317
else:
325318
# there were two ways if categories are present

0 commit comments

Comments
 (0)