NearestProx
NearestProx(x, y, k, by=None, power=1.0, lonlat=False)Each area’s k nearest areas, from one point per area (e.g. centroids).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| x | str | Columns of each area’s point coordinates in the fitted data. | required |
| y | str | Columns of each area’s point coordinates in the fitted data. | required |
| k | int | Number of neighbours of each area. | required |
| by | Literal['inverse_distance'] | None | None counts every neighbour equally; “inverse_distance” gives a neighbour 1 / distance**power. | None |
| power | float | Exponent of the inverse distance. | 1.0 |
| lonlat | bool | Read x and y as longitude and latitude in degrees; distances are then great-circle km. |
False |
Methods
| Name | Description |
|---|---|
| pairs | One row per (area, neighbour) with the distance and the proximity. |
pairs
pairs(frame, *, area)One row per (area, neighbour) with the distance and the proximity.