esda.areal_entropy¶
-
esda.areal_entropy(polygons=
None, areas=None, local=False, base=2.718281828459045)[source]¶ Compute the entropy of the distribution of polygon areas.
- Parameters:¶
- polygons : numpy array of geometries¶
polygons whose distribution of entropies needs to be computed. Should not be provided if areas is provided.
- areas : numpy array¶
areas to use to compute entropy. SHould not be provided if polygons are provided.
- local : bool (default: False)¶
whether to return the total entropy of the areal distribution (False), or to return the contribution to entropy made by each of area (True).
- Return type:¶
Total map entropy or (n,) vector of local entropies.
Example
>>> import geopandas >>> from esda import areal_entropy >>> from geodatasets import get_path >>> ch1 = geopandas.read_file(get_path('geoda.charleston1')) >>> ch2 = geopandas.read_file(get_path('geoda.charleston2')) >>> areal_entropy(polygons=ch1) np.float64(3.4511996832516347) >>> areal_entropy(polygons=ch2) np.float64(3.469953687764581)