Registry / data / categorical-distance

categorical-distance

JSON →
library1.9pypypi✓ verified 84d ago

Python library for measuring distances between categorical variables. Supports a variety of distance metrics including Hamming, Jaccard, and Dice coefficients. Version 1.9, stable.

pip install categorical-distance
INSTALL
IMPORT
SIG · CATEGORICAL-DISTAN
C
categorical-distance
datapythonv1.9
Install
3.5s avg
Import
—
Disk
89MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 89.4MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 3.5s · import 0.000s · 86MB
89MB installed
● package 89MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CategoricalComparator
✓ from categorical import CategoricalComparator
✗ from categorical_distance import categorical_distance

Compute the distance matrix between two lists of categorical values.

from categorical_distance import categorical_distance distance_matrix = categorical_distance(['a','b','c'], ['a','c','b']) print(distance_matrix)
Debug
Known issues
gotchaThe function `categorical_distance` expects lists or arrays of equal length; if lengths differ, it raises a ValueError.
fix
Ensure input lists have the same length.
affects: all
gotchaThe library does not handle missing values (NaN/None). Input must be clean categorical values.
fix
Preprocess data to remove or impute missing values before calling the function.
affects: all
deprecatedThe `distances` module is deprecated and has been replaced by `metrics`.
fix
Use `from categorical_distance import metrics` instead.
affects: <1.6
Upgrade
Version history
1.9latest on PyPI · released Jun 10, 2016
Audit
Dependencies
scipyrequiredRequired for distance matrix computation
numpyrequiredUsed for array operations
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
categorical-distance — pip install categorical-distance · libregistry