Skip to content

Commit

Permalink
started parsing of corneto attr dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
vicpaton committed Jul 26, 2024
1 parent 143846d commit d91b9c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion networkcommons/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def edge_attrs_from_corneto(graph: cn.Graph) -> pd.DataFrame:
A pandas dataframe of edge attributes.
"""

return pd.DataFrame.from_dict(graph.get_attr_edges())
edge_df = pd.DataFrame.from_dict(graph.get_attr_edges())
concat_df = pd.concat([edge_df['__source_attr'], edge_df['__target_attr']]).reset_index()
concat_df.rename(columns={0: 'node'}, inplace=True)



def to_cornetograph(graph):
Expand Down

0 comments on commit d91b9c4

Please sign in to comment.