Skip to content

Commit d89b3a3

Browse files
authored
fix edgelist bug (#25)
1 parent d45d14b commit d89b3a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

swmmnetwork/convert.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ def pandas_edgelist_to_edgelist(df, source='source', target='target', cols=None)
112112
cols = [cols]
113113
edges = edges.loc[:, cols]
114114
edge_list = []
115-
for dtype in edges.xtype.unique():
116-
_list = edges.query('xtype == @dtype').to_dict('index')
117-
edge_list.extend(list((str(k[0]), str(k[1]), v)
118-
for k, v in _list.items()))
115+
for index, row in edges.iterrows():
116+
_to, _from = index
117+
data = row.to_dict()
118+
edge_list.append([_to, _from, data])
119119
return edge_list
120120

121121

0 commit comments

Comments
 (0)