momepy.
Simpson
(gdf, values, spatial_weights, unique_id, binning='HeadTailBreaks', **classification_kwds)[source]¶Calculates the Simpson’s diversity index of values within neighbours defined in spatial_weights.
Uses mapclassify.classifiers under the hood for binning. Requires mapclassify>=.2.1.0 dependency or pysal.
GeoDataFrame containing morphological tessellation
the name of the dataframe column, np.array, or pd.Series where is stored character value.
spatial weights matrix - If None, Queen contiguity matrix of set order will be calculated based on objects.
order of Queen contiguity
One of mapclassify classification schemes Options are BoxPlot, EqualInterval, FisherJenks, FisherJenksSampled, HeadTailBreaks, JenksCaspall, JenksCaspallForced, JenksCaspallSampled, MaxPClassifier, MaximumBreaks, NaturalBreaks, Quantiles, Percentiles, StdMean, UserDefined
Keyword arguments for classification scheme For details see mapclassify documentation: https://pysal.org/mapclassify
References
Feliciotti A (2018) RESILIENCE AND URBAN DESIGN:A SYSTEMS APPROACH TO THE STUDY OF RESILIENCE IN URBAN FORM. LEARNING FROM THE CASE OF GORBALS. Glasgow.
Examples
>>> sw = momepy.sw_high(k=3, gdf=tessellation_df, ids='uID')
>>> tessellation_df['area_Simpson'] = mm.Simpson(tessellation_df, 'area', sw, 'uID').series
100%|██████████| 144/144 [00:00<00:00, 455.83it/s]
Series containing resulting values
original GeoDataFrame
Series containing used values
spatial weights matrix
Series containing used unique ID
binning method
generated bins
classification_kwds
__init__
(self, gdf, values, spatial_weights, unique_id, binning='HeadTailBreaks', **classification_kwds)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
|
Initialize self. |