I am new in networkx and python. I have a database has 3 columns like this:
| f_id | s_id | date |
|---|---|---|
| 12345 | 506678 | 24-05-2005 |
i want to create a network by networkx but first i need to connect the nodes based on the date
for example: lf_id -> s_id
where (->) the link is the date
I know how to create the network as a directed network but i have tried to connect the two columns and i couldn't do that so what i did is something like this:
import netowkrx as nx
import pandas as pd
df = pd.read_csv("connect_data.csv")
df1 = df[['f_id', 's_id', 'date']]
G = nx.DiGraph()
G = nx.from_pandas_dataframe(df,['f_id','s_id'])
but that not make it right! and i couldn't figure out a way can anyone help please on how to connect the two columns based on the dates.