add_categories(self, new_categories, inplace=<no_default>)
:None:None:`new_categories`
will be included at the last/highest place in the categories and will be unused directly after this call.
The new categories to be included.
Whether or not to add the categories inplace or return a copy of this categorical with added categories.
If the new categories include old categories or do not validate as categories
Categorical with new categories added or None if inplace=True
.
Add new categories.
remove_categories
Remove the specified categories.
remove_unused_categories
Remove categories which are not used.
rename_categories
Rename categories.
reorder_categories
Reorder categories.
set_categories
Set the categories to the specified ones.
>>> c = pd.Categorical(['c', 'b', 'c'])This example is valid syntax, but we were not able to check execution
... c ['c', 'b', 'c'] Categories (2, object): ['b', 'c']
>>> c.add_categories(['d', 'a']) ['c', 'b', 'c'] Categories (4, object): ['b', 'c', 'd', 'a']See :
The following pages refer to to this document either explicitly or contain code examples using this.
pandas.core.arrays.categorical.Categorical.set_categories
pandas.core.arrays.categorical.Categorical.remove_categories
pandas.core.arrays.categorical.Categorical.rename_categories
pandas.core.arrays.categorical.Categorical.remove_unused_categories
pandas.core.arrays.categorical.Categorical.reorder_categories
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them