Given a sample data frame df:
import pandas as pd
df = pd.DataFrame({
'id': [1, 2, 3, 4, 5],
'a': [55, 2123, -19.3, 9, -8],
'b': ['aa', 'bb', 'ad', 'kuku', 'lulu']
})
Now I want to "upload" this data to a graph. Every row should be a node with id, a, and b attributes.
I have tried to do this with from_pandas_dataframe NetworkX method.
Please advise which function is responsible to do this in NetworkX?
CodePudding user response:
Then remove the dummy node:
G.remove_node('none')


