pysal.lib.weights.shimbel

pysal.lib.weights.shimbel(w)[source]

Find the Shimbel matrix for first order contiguity matrix.

Parameters:
w : W

spatial weights object

Returns:
info : list

list of lists; one list for each observation which stores the shortest order between it and each of the the other observations.

Examples

>>> from pysal.lib.weights import lat2W
>>> w5 = lat2W()
>>> w5_shimbel = shimbel(w5)
>>> w5_shimbel[0][24]
8
>>> w5_shimbel[0][0:4]
[-1, 1, 2, 3]
>>>