We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f132bb commit 512c6aaCopy full SHA for 512c6aa
python/usearch/index.py
@@ -1665,7 +1665,9 @@ def kmeans(
1665
"""
1666
metric = _normalize_metric(metric)
1667
dtype = _normalize_dtype(dtype, ndim=X.shape[1], metric=metric)
1668
- seed = np.random.randint(0, 2**32 - 1) if seed is None else seed
+
1669
+ # Generating a 64-bit unsigned integer in NumPy may be somewhat tricky.
1670
+ seed = np.random.default_rng().integers(0, 2**64, dtype=np.uint64) if seed is None else seed
1671
assignments, distances, centroids = _kmeans(
1672
X,
1673
k,
0 commit comments