momepy.
Theil
(gdf, values, spatial_weights, unique_id, rng=None)[source]¶Calculates the Theil measure of inequality of values within neighbours defined in spatial_weights.
Uses inequality.theil.Theil under the hood. Requires ‘inequality’ package.
GeoDataFrame containing morphological tessellation
the name of the dataframe column, np.array, or pd.Series where is stored character value.
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.
Examples
>>> sw = momepy.sw_high(k=3, gdf=tessellation_df, ids='uID')
>>> tessellation_df['area_Theil'] = mm.Theil(tessellation_df, 'area', sw, 'uID').series
100%|██████████| 144/144 [00:00<00:00, 597.37it/s]
Series containing resulting values
original GeoDataFrame
Series containing used values
spatial weights matrix
Series containing used unique ID
range
__init__
(self, gdf, values, spatial_weights, unique_id, rng=None)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
|
Initialize self. |