Home > Back-end >  how to convert csv file in proper format so that it can be used in networkx
how to convert csv file in proper format so that it can be used in networkx

Time:04-04

i have the list of nodes but I don't have the list of edges which is essential for graph but there is relationship b/w nodes through patient id and provider id how to convert csv in proper format so the id column in this image represent nodes but I need edge list those nodes that have common provider and patient id will form edge how to convert this csv file in proper format

CodePudding user response:

edges = dataframe.groupby('PATIENTID')['Id'].apply(list) this works for me and I got the list of nodes against each patient id.

  • Related