data = pd.read_csv('/content/drive/MyDrive/processed_data.csv')
G=nx.from_pandas_edgelist(data, 'Primary_id', 'id', edge_attr = ['Location','month', 'day','year'], create_using=nx.DiGraph())
G.number_of_edges()
keys = []
for i in range(0,G.number_of_edges()):
if(list(nx.get_edge_attributes(G,'Location').values())[i] != 'xxxx'):
keys.append(nx.get_edge_attributes(G,'Location').keys())
This code doesn’t work in my computer due to out of memory problem
New contributor
조준우 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.