Skip to content

Instantly share code, notes, and snippets.

@FelixChop
Created August 7, 2018 11:21
Show Gist options
  • Select an option

  • Save FelixChop/e3fd1ad540400b1089a054989957e3a3 to your computer and use it in GitHub Desktop.

Select an option

Save FelixChop/e3fd1ad540400b1089a054989957e3a3 to your computer and use it in GitHub Desktop.
import pandas as pd
import networkx as nx
df = pd.DataFrame({'ID':[1,2,3],
'First Name':['Felix', 'Jean', 'James'],
'Family Name': ['Revert', 'Durand', 'Wright'],
'Phone number': ['+33 6 99 99 99 99', '+33 7 00 00 00 00', '+33 6 99 99 99 99'],
'Email': ['felix.revert@gmail.com', 'jean.durand@gmail.com', pd.np.nan],
'Zip Code': ['75001', '10350', pd.np.nan]})
G=nx.Graph()
G.add_nodes_from(df.ID.unique().tolist(), label='user')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment