3 ms·
The post is about using numpy or pypy to get better speed in python since in python for is slow. That is well known, is like the well known fact that you should
by noreasonw 11y ago
The post is about using numpy or pypy to get better speed in python since in python for is slow. That is well known, is like the well known fact that you should use vectorized operations in R to get better performance. Anyway there is something interesting: The problem of given a point P0 as input, find the the nearest point to P0 among a fixed billion points (all of them on a sphere) can be solved easily and quickly. You should be surprised the code a mathematician could devise to solve this.
- jfpuget 11y agoI agree it is well known. I am just providing yet another example. I contemplated quad trees but the performance of these 2 lines of code was good enough. Why would I bother writing something more complex? you'd be surprised by my mathematical background ;)