for i in range(1, N):
    r_min = 10
for j in range(m):
    r = 0
for k in range(D):
    r += (x[i, k] - xc[j, k]) ** 2
r = r ** 0.5
if r < r_min:
    r_min = r
if r_min > radius:
    m = m + 1
for k in range(D):
    xc[m - 1, k] = x[i, k]
nonzero = np.nonzero(xc[:, (0)])[0]
xc = xc[(nonzero), :]
return xc
Build an approximately uniform grid from random sample (python)