movingclusterlib
This library implements a tool to analyze cluster evolution during the time for a given Pandas dataframe.
Installation
pip install movingclusterlib
Usage example
import numpy as np
from movingclusterlib import GraphAnalizer, gates, plot_clusters
df = ...
# Cluster analysis
ga = GraphAnalizer(
edge_func=gates.And(
gates.TimeWindow(40000),
gates.Equal("a"),
).full_code(),
features={
'ts': np.uint32,
'a': np.int32,
},
)
df['cluster_id'], df['cluster_size'] = ga.process(df)
# Plot 10 biggest clusters on a diagram
plot_clusters(df['ts'], df['cluster_id'], df['cluster_size'], size=10)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file movingclusterlib-0.1.2.tar.gz.
File metadata
- Download URL: movingclusterlib-0.1.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/4.0.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2f8ec2c7d85d82ec5d12773a15fec09fdafcc245f5ae1dfd92eb759a151594d
|
|
| MD5 |
74d4ac6e9bfed0322af456a6ba30eb09
|
|
| BLAKE2b-256 |
0899b93ff0d64418668a70baea55d9c8d2cf27321d8649f94bcb3a1dbd30c6be
|