In this comment, joferkington refers to the current question and says:
Just for whatever it’s worth,
scipy.spatial.KDTree
(and/or scipy.spatial.cKDTree, which is written in C for performance reasons) is a far more robust choice than the options listed.
More Related Contents:
- Why is “1000000000000000 in range(1000000000000001)” so fast in Python 3?
- How do I profile a Python script?
- String formatting: % vs. .format vs. f-string literal
- When should I (not) want to use pandas apply() in my code?
- How to measure elapsed time in Python?
- Speed up millions of regex replacements in Python 3
- Get the second largest number in a list in linear time
- Link ATLAS/MKL to an installed Numpy
- Fastest way to grow a numpy numeric array
- Speed of calculating powers (in python)
- What is the fastest way to parse large XML docs in Python?
- Optimal HDF5 dataset chunk shape for reading rows
- What is the time complexity of popping elements from list in Python?
- Interactive large plot with ~20 million sample points and gigabytes of data
- Vectorizing Haversine distance calculation in Python
- Poor scaling of multiprocessing Pool.map() on a list of large objects: How to achieve better parallel scaling in python?
- Fast arbitrary distribution random sampling (inverse transform sampling)
- Mass string replace in python?
- Python: get a dict from a list based on something inside the dict
- Why is variable1 += variable2 much faster than variable1 = variable1 + variable2?
- Why is `np.sum(range(N))` very slow?
- Python built-in sum function vs. for loop performance
- Performance: Matlab vs Python
- Are NumPy’s math functions faster than Python’s?
- Creating an empty list in Python
- Dictionary vs Object – which is more efficient and why?
- Python: iterating over list vs over dict items efficiency
- First items in inner list efficiently as possible [duplicate]
- Select the max row per group – pandas performance issue
- Is there a reason Python 3 enumerates slower than Python 2?