
Product
A New Design for GitHub PR Comments
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.
A package implementing a vantage-point data structure, for efficient nearest neighbor searching.
.. image:: https://badge.fury.io/py/vptree.svg :target: https://badge.fury.io/py/vptree
.. image:: https://app.travis-ci.com/RickardSjogren/vptree.svg?branch=master :target: https://app.travis-ci.com/RickardSjogren/vptree
This package contains an implementation of a vantage-point tree <https://en.wikipedia.org/wiki/Vantage-point_tree>
_ data structure.
Simply install through pip:
.. code-block::
pip install vptree
Example usage:
.. code-block:: python
import numpy as np import vptree
def euclidean(p1, p2): return np.sqrt(np.sum(np.power(p2 - p1, 2)))
points = np.random.randn(20000, 10) query = [.5] * 10
tree = vptree.VPTree(points, euclidean)
tree.get_nearest_neighbor(query)
tree.get_n_nearest_neighbors(query, 10)
tree.get_all_in_range(query, 3.14)
FAQs
A package implementing a vantage-point data structure, for efficient nearest neighbor searching.
We found that vptree demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.
Product
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.
Security News
Slopsquatting is a new supply chain threat where AI-assisted code generators recommend hallucinated packages that attackers register and weaponize.