We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87a54fe commit cddc574Copy full SHA for cddc574
pandas/core/arrays/categorical.py
@@ -468,10 +468,10 @@ def __init__(
468
try:
469
codes, categories = factorize(values, sort=True)
470
except TypeError as err:
471
- # raise, as we don't have a sortable data structure and so
472
- # the user should give us one by specifying categories
473
codes, categories = factorize(values, sort=False)
474
if dtype.ordered:
+ # raise, as we don't have a sortable data structure and so
+ # the user should give us one by specifying categories
475
raise TypeError(
476
"'values' is not ordered, please "
477
"explicitly specify the categories order "
0 commit comments