categorical-distance

Compare two categorical variables


License
MIT
Install
pip install categorical-distance==1.1

Documentation

categorical-distance

Compare categorical variables

>>> import categorical
>>> categories = ('a', 'b')
>>> comparator = categorical.CategoricalComparator(categories)
>>> comparator('a', 'a')
[ 0.  0.]
>>> comparator('b', 'b')
[ 1.  0.]
>>> comparator('a', 'b')
[ 0.  1.]
>>> comparator('b', 'a')
[ 0.  1.]