libpysal.weights.shimbel

libpysal.weights.shimbel(w)[source]

Find the Shimbel matrix for first order contiguity matrix.

Parameters:
wW

spatial weights object

Returns:
infolist

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

Examples

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