dictances
Distances and divergences between distributions implemented in python.
How do I install this package?
As usual, just download it using pip:
pip install dictances
Tests Coverage
Since some software handling coverages sometime get slightly different results, here’s three of them:
Available metrics
A number of distances and divergences are available:
Distances |
Methods |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Usage example
from dictances import cosine
cosine(my_first_dictionary, my_second_dictionary)
Handling nested dictionaries
If you need to compute the distance between two nested dictionaries you can use deflate_dict as follows:
from dictances import cosine
from deflate_dict import deflate
my_first_dictionary = {
"a": 8,
"b": {
"c": 3,
"d": 6
}
}
my_second_dictionary = {
"b": {
"c": 8,
"d": 1
},
"y": 3,
}
cosine(deflate(my_first_dictionary), deflate(my_second_dictionary))
Release files for dictances 1.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dictances-1.5.2.tar.gz | 8.6 kB | Details |
Release files / dictances-1.5.2.tar.gz
| Download URL | dictances-1.5.2.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66cbe49c272baf4101a0a6504c8129f6a79399d2167d990fd378b8deed5d878a
|
|
BLAKE2b-256 checksum How to use checksums |
bd49a5a430d3a74f43e29c9481ab830cd0353142e3cf70cd2da659132ee5a948
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|