libpysal.weights.shimbel¶
- libpysal.weights.shimbel(w)[source]¶
Find the Shimbel matrix for first order contiguity matrix.
- Parameters:
- w
W
spatial weights object
- w
- 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.
- info
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]