ash-dendro package
This package contains two dendrogram utilities
- utility to split dendrogram by selecting a nodes
- utility to parse R hclust format to linkage matrix used by Scipy
Example Usage
import pandas as pd
from scipy.cluster.hierarchy import dendrogram
import matplotlib.pyplot as plt
import numpy as np
from ash_dendro.utils import parse_order_df, parse_heights_df, parse_r_hclust, split_dendrogram
# Input data are expected to be in pandas dataframes
# Iris sample data can be used for this purpose
BASE_PATH = "<INSERT YOUR LOCAL PATH>"
heights = pd.read_csv(f"{BASE_PATH}/iris/heights.csv")
order = pd.read_csv(f"{BASE_PATH}/iris/order.csv")
merge = pd.read_csv(f"{BASE_PATH}/iris/merge.csv")
parsed_order = parse_order_df(order)
parsed_heights = parse_heights_df(heights)
# convert from R hclust format to linkage matrix used in Scipy
parsed_merge = parse_r_hclust(
merge,
parsed_heights,
parsed_order
)
plt.figure()
dendrogram(parsed_merge)
plt.show()
nodes_to_split = [3, 8]
clusters_ids_to_assign = [1, 2]
r = split_dendrogram(
np.array(parsed_merge),
nodes_to_split,
clusters_ids_to_assign,
)
print(r)
Metadata
Release files for ash-dendro 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ash_dendro-0.0.7.tar.gz | 3.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ash_dendro-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 kB
Release files / ash_dendro-0.0.7.tar.gz
| Download URL | ash_dendro-0.0.7.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c9fe69d941a1e618132eb07c5bb616ecb39a2ad96cd4d8e00b988ad6885f6c5
|
|
BLAKE2b-256 checksum How to use checksums |
45152ac24880582e3d2984ad9864ed402a255f3c143e118708b8d66b50c8a0a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.8
|
Release files / ash_dendro-0.0.7-py3-none-any.whl
| Download URL | ash_dendro-0.0.7-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e71180f85d615eb084390f844ca9ac37e1fed9c085896b4450359b9368a5f9a2
|
|
BLAKE2b-256 checksum How to use checksums |
4e8d91cabcb646c6f73806d50d9477ee7a86bb2a15b1deec8ffe6115dd9f0e19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.8
|
Security for ash-dendro 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.