Skip to content
Snippets Groups Projects
Commit ed354c62 authored by Yassin's avatar Yassin
Browse files

Merge remote-tracking branch 'origin/main'

parents cdcb8a92 1fbefb1a
No related branches found
No related tags found
No related merge requests found
import numpy as np
import pandas as pd
import networkx as nx
def lcc(G):
return G.subgraph(max(nx.connected_components(G), key=len)).copy()
def cumulative_dist(name, method, values, increasing=True):
if increasing:
x = -np.sort(-np.array(values))
else:
x = np.sort(values)
y = np.arange(1, len(x) + 1)/len(x)
df = pd.DataFrame(index=x)
df.index.name = name
df[method] = y
return df
def edge_properties(df):
columns = list(df.columns)
columns.remove('source')
columns.remove('target')
return columns
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment