I’m using the network x function read_edgelist on a public dataset available from network repository (https://networkrepository.com/escorts.php) and the meta data shows there are approximately 50k edges, but when I use the above function, I’m only seeing 39k edges.
My code:
import networkx as nx
g = nx.read_edgelist(filepath, comments=’%’, data=[(‘rank’,int),(‘timestamp’,float)])
print(g)
output : Graph with 10106 nodes and 39024 edges
Which is not what I’m anticipating when compared to the metadata provided:
metadata screengrab
And if I open the .edge file in vs code I can see the 50K edges do appear as you would expect:
vs code screengrab
Samuel Hardon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.