categorical
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AddCategories datacook.engine.ops.categorical |
|
|
| AsOrdered datacook.engine.ops.categorical |
|
|
| AsUnordered datacook.engine.ops.categorical |
|
|
| RemoveCategories datacook.engine.ops.categorical |
|
|
| RemoveUnusedCategories datacook.engine.ops.categorical |
|
|
| RenameCategories datacook.engine.ops.categorical |
|
|
| ReorderCategories datacook.engine.ops.categorical |
|
|
| SetCategories datacook.engine.ops.categorical |
|
🛈 DocStrings¶
Categorical column ops (.cat accessor): add, remove, rename, reorder, set categories.
Categorical columns use the pandas category dtype (from "Change data type" with
"category"); its categories keep their arrow-backed dtype. Arrow dictionary columns have
no .cat accessor: convert them to category first. Every op works on one column and
replaces it in place: df = df.assign(c=df["c"].cat.add_categories(["x"])).