[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
Gephi forumsPlease post new questions on facebook group too (https://www.facebook.com/groups/gephi) 2021-11-06T18:45:34+01:00 https://forum-gephi.org/app.php/feed/topic/6657 2021-11-06T18:45:34+01:002021-11-06T18:45:34+01:00 https://forum-gephi.org/viewtopic.php?t=6657&p=15409#p15409 <![CDATA[Exporting GEXF from Python networkx: label problem]]> I am building a graph with python's networkx library and then writing it out with tne nx.write_gexf(G, filename) function.

The graph is a multigraph with the nodes being authors and an edge added each time it coauthors with someone else.

Upon importing all goes well, I simply SUM the edges if there are more than one between two nodes and all the date is to be found in the data laboratory but I find that the Label column is empty and there is ANOTHER Label column added with the names.

This is how I iterate through my authors (pis) dataframe and build the nodes:

for index, row in pis.iterrows():
G.add_node(row['scid'], Label=row['name'], hindex=row['hindex'], lastyear=row['recentyear'], cits=row['cits'], role='PI', affil="IIT")

What am I doing wrong? Can't I directly have the labels filled for me?

The solution right now is manual: use the copy from another column and copy the "Label" column in the real Label column but it is a bit cumbersome.

Thanks a lot.

Statistics:Posted by rjalex — 06 Nov 2021 18:45


]]>