Skip to content

Commit b9b44ca

Browse files
Update find-nearest-neigbours.py
1 parent 61e9cde commit b9b44ca

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

find-nearest-neigbours.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import numpy as np
2-
3-
def find_nearest_neighbors(p, points, k=5):
4-
"""
1+
"""
52
Find the k nearest neighbors of points and return the indexes of nearest neigbor k
63
usage:
74
//Generate points.
@@ -17,8 +14,11 @@ def find_nearest_neighbors(p, points, k=5):
1714
OUTPUT:
1815
[[2 2]
1916
[3 2]]
20-
"""
21-
17+
"""
18+
19+
import numpy as np
20+
21+
def find_nearest_neighbors(p, points, k=5):
2222
distances = np.zeros(points.shape[0])
2323
#loop through
2424
for i in range(len(distances)):

0 commit comments

Comments
 (0)