def set_ordered(self, value, inplace=False):
        if not is_bool(value):
            raise TypeError("ordered must be a boolean value")
        cat = self if inplace else self.copy()
        cat._ordered = value
        if not inplace:
            return cat
Sets the ordered attribute to the boolean value
dataset/ETHPy150Open pydata/pandas/pandas/core/categorical.py/Categorical.set_ordered