Skip to main content

hopkins-statistic

CI Coverage PyPI - Version PyPI - Python Version Docs DOI

hopkins-statistic is a library for computing the Hopkins statistic to assess clustering tendency (also known as clusterability) by testing for departure from complete spatial randomness (CSR) in point patterns.

This implementation defaults to the Cross and Jain (1982) formulation, raising distances to the power of the data dimension. In two dimensions, this matches the original definition by Hopkins and Skellam (1954). Because the resulting statistic follows a beta distribution under the null hypothesis, p-values can be computed analytically, avoiding the need for Monte Carlo simulations.

Installation

pip install hopkins-statistic

Usage

import numpy as np
from hopkins_statistic import hopkins

rng = np.random.default_rng(42)
X = rng.uniform(size=(100, 2))

statistic = hopkins(X, rng=rng)
print(f"{statistic:.3f}")
#> 0.514

License

This project is licensed under the terms of the MIT license.

Metadata

Release files for hopkins-statistic 0.7.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 hopkins-statistic 0.7.1
File Size Uploaded Provenance Actions
hopkins_statistic-0.7.1.tar.gz 8.3 kB Without provenance Details for hopkins_statistic-0.7.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hopkins-statistic 0.7.1
File Interpreter ABI Platform Actions
hopkins_statistic-0.7.1-py3-none-any.whl Python 3 none any Details for hopkins_statistic-0.7.1-py3-none-any.whl

Total release size: 18.3 kB

Release files / hopkins_statistic-0.7.1.tar.gz

Download URL hopkins_statistic-0.7.1.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2057d1fde088301986179ff64c9ead19dd3f237a8e115655a61d77d3d168800a
BLAKE2b-256 checksum
How to use checksums
d359f6ee26b6c8c557fa1b6c4408de69d8faf68de19d2f877fe0f60206b720c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / hopkins_statistic-0.7.1-py3-none-any.whl

Download URL hopkins_statistic-0.7.1-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ca2097fb816f0f832391b057c72d381a8ba9925a452cf3624e0ff4db994614e
BLAKE2b-256 checksum
How to use checksums
22ed93f97dffb47eb9da4b4ecad68909964b85721155ae89ed791ee881bcb746
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for hopkins-statistic 0.7.1

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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