Skip to content

Commit a41ae5b

Browse files
Replaced legacy np.random.rand call with np.random.Generator in kd_tree/example_usage.py
1 parent 3222bd3 commit a41ae5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

data_structures/kd_tree/example/example_usage.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
points = hypercube_points(num_points, cube_size, num_dimensions)
1313
hypercube_kdtree = build_kdtree(points.tolist())
1414

15-
query_point = np.random.rand(num_dimensions).tolist()
15+
rng = np.random.default_rng()
16+
query_point = rng.random(num_dimensions).tolist()
1617

1718
nearest_point, nearest_dist, nodes_visited = nearest_neighbour_search(
1819
hypercube_kdtree, query_point

0 commit comments

Comments
 (0)