Skip to main content

Calculate Euclidean distances between two sets of coordinates (Cython and Numexpr)

Tested against Windows / Python 3.11 / Anaconda

pip install cythoneuclideandistance

Calculate Euclidean distances between two sets of coordinates.

This function computes the Euclidean distance matrix between two sets of coordinates.

Args:
    coords1 (numpy.ndarray): An array of shape (n, 2) containing the first set of coordinates.
    coords2 (numpy.ndarray): An array of shape (m, 2) containing the second set of coordinates.

Returns:
    numpy.ndarray: A 2D array of shape (n, m) containing the Euclidean distances between all pairs of coordinates.

Example:
    import random
    import cythoneuclideandistance
    import numpy as np

    coords1 = np.array(
        [[random.randint(1, 1000), random.randint(1, 1000)] for _ in range(23000)],
        dtype=np.int32,
    )
    coords2 = np.array(
        [[random.randint(1, 1000), random.randint(1, 1000)] for _ in range(22150)],
        dtype=np.int32,
    )

    distance_matrix = cythoneuclideandistance.calculate_euc_distance(coords1, coords2)
    print(distance_matrix)

Metadata

Release files for cythoneuclideandistance 0.11

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

Source distribution (sdist)

Source distribution for cythoneuclideandistance 0.11
File Size Uploaded Provenance Actions
cythoneuclideandistance-0.11.tar.gz 21.5 kB Without provenance Details for cythoneuclideandistance-0.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cythoneuclideandistance 0.11
File Interpreter ABI Platform Actions
cythoneuclideandistance-0.11-py3-none-any.whl Python 3 none any Details for cythoneuclideandistance-0.11-py3-none-any.whl

Total release size: 43.9 kB

Release files / cythoneuclideandistance-0.11.tar.gz

Download URL cythoneuclideandistance-0.11.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
768a2bab45157265e87ce6f7d4386cfce2b47ec1e39bce31526757b38927373a
BLAKE2b-256 checksum
How to use checksums
d142b3bfd1163595560a60636757e31eccc6c885206869336331449d0a78834f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / cythoneuclideandistance-0.11-py3-none-any.whl

Download URL cythoneuclideandistance-0.11-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fcdf6b9bfaa74e4232bd3c5b617a7a7afef53d80bdd596a01ebf03fb4e254f7
BLAKE2b-256 checksum
How to use checksums
745ae617eb8abe727b54cc554fd8d8415d0ab20a7ede9dcbc5f8699a6804c6bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for cythoneuclideandistance 0.11

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.

Release history Release notifications | RSS feed

This release

0.11 This release

2 release files No provenance

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