I am looking to convert a Pajek dataset into a networkx Graph()
. The dataset comes from Costa Rican Family Ties. I am using the very handy networkx.read_pajek(pathname)
function, but am running into some trouble. I do the following commands on my terminal window (iPython) after changing to the right directory, importing networkx as nx
and matplotlib.pyplot as plt
:
>> G = nx.read_pajek('SanJuanSur.paj')
>> nx.draw(G)
>> fig = plt.figure(figsize = (15, 10))
>> nx.draw(G)
>> plt.show()
Something unusual is happening--obviously, and was hoping a seasoned person might be able to help me. It looks like the .paj
file has many different parts jammed into the one file I have downloaded. Not really sure how to break it up since there is no comments and seems like Pajek in general is meant to operate with a GUI.
>> G.node['f49']
{'id': '49', 'shape': '0.5000', 'x': 0.5533, 'y': 0.3766}
Was hoping to use the status of the nodes (attributes that range from 0-14). Thank you!