Skip to main content
`Ctrl`+`K`

# pandas.CategoricalDtype.ordered

property CategoricalDtype.ordered

  Whether the categories have an ordered relationship.

  When `True`, comparison operations on the resulting Categorical are valid and sort in the order of the categories.

  See also

  `categories`

    An Index containing the unique categories allowed.

  Examples

      >>> cat_type = pd.CategoricalDtype(categories=["a", "b"], ordered=True)
      >>> cat_type.ordered
      True

      >>> cat_type = pd.CategoricalDtype(categories=["a", "b"], ordered=False)
      >>> cat_type.ordered
      False