esda.isolation

esda.isolation(X, coordinates, metric='euclidean', middle='mean', return_all=False, progressbar=False)[source]

Compute the isolation of each value of X by constructing the distance to the nearest higher value in the data.

Parameters:
Xnumpy.ndarray

(N, p) array of data to use as input. If p > 1, the “elevation” is computed using the topo.to_elevation function.

coordinatesnumpy.ndarray

(N,k) array of locations for X to compute distances. If metric=’precomputed’, this should contain the distances from each point to every other point, and k == N.

metricstr or callable() (default: ‘euclidean’)

name of distance metric in scipy.spatial.distance, or function, that can be used to compute distances between locations. If ‘precomputed’, ad-hoc function will be defined to look up distances between points instead.

middlestr or callable() (default: ‘mean’)

method to define the elevation of points. See to_elevation for more details.

return_allbool (default: False)

if False, only return the isolation (distance to nearest higher value).

progressbar: bool (default: False)

if True, show a progressbar for the computation.

Returns
——-
either (N,) array of isolation values, or a pandas dataframe containing the full
tree of precedence for the isolation tree.