esda.nearest_label

esda.nearest_label(data, labels, metric=<function euclidean_distances at 0x7f277d999c10>, return_distance=False, keep_self=False)[source]

Find the nearest label in attribute space.

Given the data and a set of labels in labels, this finds the label whose mean center is closest to the observation in data.

Returns
(N_obs,) array of assignments reflect each observation’s nearest label.
If return_distance is True, a tuple of ((N,) and (N,)) where the first

array is the assignment, and the second is the distance to the centroid of that assignment.