momepy.
Range
Calculates the range of values within neighbours defined in spatial_weights.
spatial_weights
Uses scipy.stats.iqr under the hood.
scipy.stats.iqr
Adapted from [DPR+17].
GeoDataFrame containing morphological tessellation
the name of the dataframe column, np.array, or pd.Series where is stored character value.
np.array
pd.Series
spatial weights matrix
name of the column with unique id used as spatial_weights index
Percentiles over which to compute the range. Each must be between 0 and 100, inclusive. The order of the elements is not important.
optional arguments for scipy.stats.iqr
if True, shows progress bars in loops and indication of steps
Examples
>>> sw = momepy.sw_high(k=3, gdf=tessellation_df, ids='uID') >>> tessellation_df['area_IQR_3steps'] = mm.Range(tessellation_df, ... 'area', ... sw, ... 'uID', ... rng=(25, 75)).series 100%|██████████| 144/144 [00:00<00:00, 722.50it/s]
Series containing resulting values
original GeoDataFrame
Series containing used values
Series containing used unique ID
range
kwargs
__init__
Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(gdf, values, spatial_weights, unique_id)
Initialize self.