momepy.
WeightedCharacter
Calculates the weighted character
Character weighted by the area of the objects within k topological steps defined in spatial_weights.
k
spatial_weights
Adapted from [DPR+17].
GeoDataFrame containing objects to analyse
the name of the gdf dataframe column, np.array, or pd.Series where is stored character to be weighted
np.array
pd.Series
spatial weights matrix - If None, Queen contiguity matrix of set order will be calculated based on left.
name of the column with unique id used as spatial_weights index.
the name of the left dataframe column, np.array, or pd.Series where is stored area value
if True, shows progress bars in loops and indication of steps
Examples
>>> sw = libpysal.weights.DistanceBand.from_dataframe(tessellation_df, threshold=100, silence_warnings=True) >>> buildings_df['w_height_100'] = momepy.WeightedCharacter(buildings_df, values='height', spatial_weights=sw, unique_id='uID').series 100%|██████████| 144/144 [00:00<00:00, 361.60it/s]
Series containing resulting values
original GeoDataFrame
Series containing used values
Series containing used areas
spatial weights matrix
Series containing used unique ID
__init__
Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(gdf, values, spatial_weights, unique_id)
Initialize self.