Convert this implementation to a more efficient usage of numpy
Essentially for every instance D[i] <= num, I want to use that index to add numpy x[i] to nx and numpy y[i] to ny it to the new numpy array nx, ny.
row, = D.shape
for i in range(row):
if D[i] <= num:
nx.append(x[i])
ny.append(y[i])
