Skip to content

Commit

Permalink
Нет предела совершенства
Browse files Browse the repository at this point in the history
  • Loading branch information
TreshMom committed Feb 21, 2024
1 parent f2f1f50 commit 0d9f5b9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions project/task_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@


def graph_info(name_graph: str) -> Tuple[int, int, Set[str]]:
graph_path = cfpq_data.download(name_graph)
graph = cfpq_data.graph_from_csv(graph_path)
labels = set()
for _, _, data in name_graph.edges(data=True):
for _, _, data in graph.edges(data=True):
if 'label' in data:
labels.add(data['label'])


return (
name_graph.number_of_nodes(),
name_graph.number_of_edges(),
graph.number_of_nodes(),
graph.number_of_edges(),
labels
)

Expand Down

0 comments on commit 0d9f5b9

Please sign in to comment.