Skip to main content

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


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.2.tar.gz (3.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page