Set the ordered attribute to the boolean value. Parameters ---------- value : bool Set whether this categorical is ordered (True) or not (False).
(self, value: bool)
| 992 | return type(self)._simple_new(codes, dtype=dtype) |
| 993 | |
| 994 | def set_ordered(self, value: bool) -> Self: |
| 995 | """ |
| 996 | Set the ordered attribute to the boolean value. |
| 997 | |
| 998 | Parameters |
| 999 | ---------- |
| 1000 | value : bool |
| 1001 | Set whether this categorical is ordered (True) or not (False). |
| 1002 | """ |
| 1003 | new_dtype = CategoricalDtype(self.categories, ordered=value) |
| 1004 | cat = self.copy() |
| 1005 | NDArrayBacked.__init__(cat, cat._ndarray, new_dtype) |
| 1006 | return cat |
| 1007 | |
| 1008 | def as_ordered(self) -> Self: |
| 1009 | """ |