momepy.
NeighborDistance
Calculate the mean distance to adjacent buildings (based on spatial_weights)
spatial_weights
If no neighbours are found, return np.nan.
np.nan
Adapted from [SA15].
GeoDataFrame containing objects to analyse
spatial weights matrix based on unique_id
name of the column with unique id used as spatial_weights index.
if True, shows progress bars in loops and indication of steps
Examples
>>> buildings_df['neighbour_distance'] = momepy.NeighborDistance(buildings_df, sw, 'uID').series 100%|██████████| 144/144 [00:00<00:00, 345.78it/s] >>> buildings_df['neighbour_distance'][0] 29.18589019096464
Series containing resulting values
original GeoDataFrame
spatial weights matrix
Series containing used unique ID
__init__
Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(gdf, spatial_weights, unique_id[, …])
Initialize self.