segregation.spatial.SpatialMinMax

class segregation.spatial.SpatialMinMax(data, group_pop_var, total_pop_var, network=None, w=None, decay='linear', distance=2000, precompute=True)[source]

Spatial MinMax Index.

This class calculates the spatial version of the MinMax index. The data are “spatialized” by converting each observation to a “local environment” by creating a weighted sum of the focal unit with its neighboring observations, where the neighborhood is defined by a libpysal weights matrix or a pandana Network instance.

Parameters
datageopandas.GeoDataFrame

geodataframe with

group_pop_varstring

The name of variable in data that contains the population size of the group of interest

total_pop_varstring

The name of variable in data that contains the total population of the unit

wlibpysal.W

distance-based PySAL spatial weights matrix instance

networkpandana.Network

pandana.Network instance. This is likely created with get_osm_network or via helper functions from OSMnet or UrbanAccess.

distanceint

maximum distance to consider accessible (the default is 2000).

decaystr

decay type pandana should use “linear”, “exp”, or “flat” (which means no decay). The default is “linear”.

precompute: bool

Whether the pandana.Network instance should precompute the range queries.This is true by default, but if you plan to calculate several indices using the same network, then you can set this parameter to False to avoid precomputing repeatedly inside the function

Notes

Based on O’Sullivan & Wong (2007). A Surface‐Based Approach to Measuring Spatial Segregation. Geographical Analysis 39 (2). https://doi.org/10.1111/j.1538-4632.2007.00699.x

Reference: [OSullivanW07].

We’d like to thank @AnttiHaerkoenen for this contribution!

Attributes
statisticfloat

SpatialMinMax Index

core_dataa pandas DataFrame

A pandas DataFrame that contains the columns used to perform the estimate.

__init__(data, group_pop_var, total_pop_var, network=None, w=None, decay='linear', distance=2000, precompute=True)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(data, group_pop_var, total_pop_var)

Initialize self.