No project description provided
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
movingclusterlib-0.1.1.tar.gz
(3.0 kB
view hashes)