Skip to content

Commit

Permalink
CLN: use dtype in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
topper-123 committed Feb 2, 2019
1 parent 2b16e2e commit 2b7b928
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2321,8 +2321,7 @@ def _values_for_factorize(self):
@classmethod
def _from_factorized(cls, uniques, original):
return original._constructor(original.categories.take(uniques),
categories=original.categories,
ordered=original.ordered)
dtype=original.dtypes)

def equals(self, other):
"""
Expand Down Expand Up @@ -2674,9 +2673,7 @@ def _factorize_from_iterable(values):
if is_categorical(values):
if isinstance(values, (ABCCategoricalIndex, ABCSeries)):
values = values._values
categories = CategoricalIndex(values.categories,
categories=values.categories,
ordered=values.ordered)
categories = CategoricalIndex(values.categories, dtype=values.dtype)
codes = values.codes
else:
# The value of ordered is irrelevant since we don't use cat as such,
Expand Down

0 comments on commit 2b7b928

Please sign in to comment.