From 49c69b65bd4a716b1859b15ef715ded0b1b28c20 Mon Sep 17 00:00:00 2001 From: Serge Rey Date: Sun, 15 Jan 2023 17:07:14 -0800 Subject: [PATCH] Removing internal use of id_order in to_adjlist --- libpysal/weights/weights.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libpysal/weights/weights.py b/libpysal/weights/weights.py index 9f1e4e8d6..c71e40560 100644 --- a/libpysal/weights/weights.py +++ b/libpysal/weights/weights.py @@ -432,12 +432,9 @@ def to_adjlist( links = [] focal_ix, neighbor_ix = self.sparse.nonzero() - names = np.asarray(self.id_order) - focal = names[focal_ix] - neighbor = names[neighbor_ix] weights = self.sparse.data adjlist = pandas.DataFrame( - {focal_col: focal, neighbor_col: neighbor, weight_col: weights} + {focal_col: focal_ix, neighbor_col: neighbor_ix, weight_col: weights} ) if remove_symmetric: adjlist = adjtools.filter_adjlist(adjlist)