|
|
|
|
|
by brahbrah
1183 days ago
|
|
This was a silly and unnecessary optimization. He’s just using numpy wrong. Instead of: for p in ps:
norm(p.center - point) You should do: centers = np.array([p.center for p in ps])
norm(centers - point, axis=1) You’ll get your same speed up in 2 lines without introducing a new dependency |
|