fatf.utils.distances.get_point_distance(data_array: numpy.ndarray, data_point: Union[numpy.ndarray, numpy.void], distance_function: Callable[[numpy.ndarray, numpy.ndarray], float]) → numpy.ndarray[source]

Computes the distance between a data point and an array of data.

This function computes the distances between the data_point and all rows of the data_array.


A 2-dimensional numpy array to which rows distances will be computed.

data_pointUnion[numpy.ndarray, numpy.void]

A 1-dimensional numpy array or numpy void (for structured data points) for which distances to every row of the data_array will be computed.

distance_functionCallable[[numpy.ndarray, numpy.ndarray], number]

A Python function that takes as an input two 1-dimensional numpy arrays of equal length and outputs a number representing a distance between them. The distance function is assumed to return the same distance regardless of the order in which parameters are given.


A 1-dimensional numerical numpy array with distances between data_point and every row of the data_array.


The distance function does not require exactly two parameters.


The data array is not a 2-dimensional numpy array. The data point is not 1-dimensional. The number of columns in the data array is different to the number of elements in the data point.


The data array or the data point is not of a base type (numbers and/or strings). The data point and the data array have incomparable dtypes. The distance function is not a Python callable (function).