Skip to content

pairs builtin

pairs(
    a,
    b,
    max_distance,
    *,
    values=None,
    unique=True,
    holes=None,
)

Nearest pairs between two sets of samples within max_distance, e.g. twin holes or two drilling types.

Parameters:

Name Type Description Default
a PointSet or array_like

Samples, or their (n, 2) or (n, 3) coordinates.

required
b PointSet or array_like

Samples, or their (n, 2) or (n, 3) coordinates.

required
max_distance float

Largest pairing distance.

required
values str or tuple of array_like or str

Column of both a and b, or the values (or column) of each; samples with NaN are not paired.

None
unique bool

Pair each sample at most once, the closest pairs first; else each sample of a takes its nearest of b, which may repeat.

True
holes str or tuple of array_like or str

Hole ids, as values; samples of one hole are not paired.

None

Returns:

Type Description
Table

One row per pair, by row of a: a and b rows, distance and, with values, value_a and value_b.

used in