{"id":23397,"library":"categorical-distance","title":"categorical-distance","description":"Python library for measuring distances between categorical variables. Supports a variety of distance metrics including Hamming, Jaccard, and Dice coefficients. Version 1.9, stable.","status":"active","version":"1.9","language":"python","source_language":"en","source_url":"https://github.com/datamade/categorical-distance","tags":["categorical","distance","metrics","classification"],"install":[{"cmd":"pip install categorical-distance","lang":"bash","label":"Install"}],"dependencies":[{"reason":"Required for distance matrix computation","package":"scipy","optional":false},{"reason":"Used for array operations","package":"numpy","optional":false}],"imports":[{"wrong":"from categorical_distance import categorical_distance","symbol":"CategoricalComparator","correct":"from categorical import CategoricalComparator"}],"quickstart":{"code":"from categorical_distance import categorical_distance\ndistance_matrix = categorical_distance(['a','b','c'], ['a','c','b'])\nprint(distance_matrix)","lang":"python","description":"Compute the distance matrix between two lists of categorical values."},"warnings":[{"fix":"Ensure input lists have the same length.","message":"The function `categorical_distance` expects lists or arrays of equal length; if lengths differ, it raises a ValueError.","severity":"gotcha","affected_versions":"all"},{"fix":"Preprocess data to remove or impute missing values before calling the function.","message":"The library does not handle missing values (NaN/None). Input must be clean categorical values.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from categorical_distance import metrics` instead.","message":"The `distances` module is deprecated and has been replaced by `metrics`.","severity":"deprecated","affected_versions":"<1.6"}],"env_vars":null,"search_vec":"'1.9':25 'categor':2,10,27 'categorical-dist':1 'classif':30 'coeffici':23 'dice':22 'distanc':3,8,16,28 'ham':19 'includ':18 'jaccard':20 'librari':5 'measur':7 'metric':17,29 'python':4 'stabl':26 'support':12 'variabl':11 'varieti':14 'version':24","created_at":"2026-05-01T08:07:34.139528+00:00","updated_at":"2026-05-01T08:07:34.139528+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.9","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/datamade/categorical-distance","docs":null,"changelog":null,"pypi":"https://pypi.org/project/categorical-distance/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}