spatialtis.spatial_weights#
- spatialtis.spatial_weights(data, **kwargs)[source]#
A generator that return spatial weight in CSR matrix
- Yields
- roi_namelist of string
The name of the roi.
- spatial_weight_matrixsparse matrix
A spatial weight matrix in scipy sparse matrix format.
- Examples:
>>> import spatialtis as st >>> weights_matrix_every_roi = [matrix for roi_name, matrix in st.spatial_weights(data)]