pysal.lib.weights.full

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

Generate a full numpy array.

Parameters:
w : W

spatial weights object

Returns:
(fullw, keys) : tuple

first element being the full numpy array and second element keys being the ids associated with each row in the array.

Examples

>>> from pysal.lib.weights import lat2W, W
>>> neighbors = {'first':['second'],'second':['first','third'],'third':['second']}
>>> weights = {'first':[1],'second':[1,1],'third':[1]}
>>> w = W(neighbors, weights)
>>> wf, ids = full(w)
>>> wf
array([[0., 1., 0.],
       [1., 0., 1.],
       [0., 1., 0.]])
>>> ids
['first', 'second', 'third']