Skip to content

Commit 8ff9ed1

Browse files
committed
minor optimization of dict zip construction
1 parent 250a3d6 commit 8ff9ed1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libpysal/weights/distance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __init__(
119119
if ids is None:
120120
ids = list(full_indices)
121121

122-
neighbors = dict(zip(ids, map(list, not_self_indices)))
122+
neighbors = {idx: list(indices) for idx, indices in zip(ids, not_self_indices)}
123123

124124
W.__init__(self, neighbors, id_order=ids, **kwargs)
125125

0 commit comments

Comments
 (0)