Skip to main content

pydpc - a Python package for Density Peak-based Clustering

CI codecov CodeQL Docs PyPI version PyPI downloads

Clustering by fast search and find of density peaks was designed by Alex Rodriguez and Alessandro Laio; see their project page for more information.

The pydpc package aims to make this algorithm available for Python users.

Installation

Install pydpc via pip from the Python package index

pip install pydpc

or the latest version from github

pip install git+https://github.com/cwehmeyer/pydpc.git@master

Quick start

import numpy as np
from pydpc import Cluster

# a simple bimodal data set: two gaussian blobs centered at x=-4 and x=+4
npoints = 1000
points = np.random.randn(npoints, 2)
points[:, 0] += 4 * np.random.choice([-1, 1], size=npoints)

# computes distances, density, and delta, then shows the decision graph
clu = Cluster(points)

# pick outliers in the decision graph as cluster centers and assign points
clu.assign(min_density=25, min_delta=6)

clu.membership   # cluster index for each point
clu.core_idx     # indices of high-confidence ("core") points
clu.halo_idx     # indices of low-confidence ("halo") points

See docs/examples/Example01.ipynb for a full walkthrough with plots.

See CHANGELOG.md for release history.

Metadata

Release files for pydpc 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydpc 0.2.1
File Size Uploaded
pydpc-0.2.1.tar.gz 1.2 MB Details

Release files / pydpc-0.2.1.tar.gz

Download URL pydpc-0.2.1.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
168c953d2656c73562e1fde5e9935db354669a37a91a38537c4dce5266b9f280
BLAKE2b-256 checksum
How to use checksums
b6d71cebf2a54bf835fd631115e5a6845d6e9f3b96e28632b93373fb3b57adc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file

0.2.0

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page