plydata.cat_tools.cat_concat

plydata.cat_tools.cat_concat(*args)[source]

Concatenate categoricals and combine the categories

Parameters
*argstuple

Categoricals to be concatenated

Notes

The resulting category is not ordered.

Examples

>>> c1 = pd.Categorical(['a', 'b'], categories=['b', 'a'])
>>> c2 = pd.Categorical(['d', 'a', 'c'])
>>> cat_concat(c1, c2)
['a', 'b', 'd', 'a', 'c']
Categories (4, object): ['b', 'a', 'c', 'd']