libpysal.weights.
spw_from_gal
(galfile)[source]¶Sparse scipy matrix for w from a gal file.
name of gal file including suffix
scipy sparse matrix in CSR format
identifiers for rows/cols of spw
Examples
>>> import libpysal
>>> spw = libpysal.weights.spw_from_gal(libpysal.examples.get_path("sids2.gal"))
>>> spw.sparse.nnz
462