momepy.
Unique
(gdf, values, spatial_weights, unique_id)[source]¶Calculates the number of unique values within neighbours defined in spatial_weights.
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
Examples
>>> sw = momepy.sw_high(k=3, gdf=tessellation_df, ids='uID')
>>> tessellation_df['cluster_unique'] = mm.Unique(tessellation_df, 'cluster', sw, 'uID').series
100%|██████████| 144/144 [00:00<00:00, 722.50it/s]
Series containing resulting values
original GeoDataFrame
Series containing used values
spatial weights matrix
Series containing used unique ID
__init__
(self, gdf, values, spatial_weights, unique_id)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
|
Initialize self. |