Skip to content

Commit

Permalink
drop duplicated node pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwolf committed Jul 9, 2021
1 parent 47b99fa commit fc37202
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pandana/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,13 @@ def nodes_in_range(self, nodes, radius, imp_name=None):
ext_ids = self.node_idx.index.values

raw_result = self.net.nodes_in_range(nodes, radius, imp_num, ext_ids)
return pd.concat(
clean_result = pd.concat(
[
pd.DataFrame(r, columns=["destination", imp_name]).assign(source=ix)
for r, ix in zip(raw_result, nodes)
]
)[["source", "destination", imp_name]]
return clean_result.drop_duplicates(subset=["source", "destination"])

def _imp_name_to_num(self, imp_name):
if imp_name is None:
Expand Down

0 comments on commit fc37202

Please sign in to comment.