Skip to content

Commit 6e805a5

Browse files
authored
Merge pull request #510 from sjsrey/adjlist
Removing internal use of id_order in to_adjlist
2 parents 3a09c42 + 49c69b6 commit 6e805a5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

libpysal/weights/weights.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,9 @@ def to_adjlist(
432432

433433
links = []
434434
focal_ix, neighbor_ix = self.sparse.nonzero()
435-
names = np.asarray(self.id_order)
436-
focal = names[focal_ix]
437-
neighbor = names[neighbor_ix]
438435
weights = self.sparse.data
439436
adjlist = pandas.DataFrame(
440-
{focal_col: focal, neighbor_col: neighbor, weight_col: weights}
437+
{focal_col: focal_ix, neighbor_col: neighbor_ix, weight_col: weights}
441438
)
442439
if remove_symmetric:
443440
adjlist = adjtools.filter_adjlist(adjlist)

0 commit comments

Comments
 (0)