Drop the "edgetype" keyword and use
>>> G=nx.read_edgelist('net',create_using=nx.MultiGraph())
and it should work.
If it makes sense you might want to relabel "inter" as "key"
since that is an internal NetworkX dictionary name to identify multiple
edges. If you don't specify a key an integer key will be assigned.
e.g.
In [78]: G['A']['B']
Out[78]: {0: {'inter': 'reg'}, 1: {'inter': 'ppi'}}
vs
In [80]: G['A']['B']
Out[80]: {'ppi': {}, 'reg': {}}
> After that, I have tried to constructed my network by using the following
> code (note that "gtest" is the same network shown above) :
> import networkx as nx
> gtest = {'A':{'B':{'inter': 'reg'}},'A':{'C':{'inter':
> 'ppi'}},'C':{'A':{'inter': 'ppi'}},'B':{'D':{'inter':
> 'met'}},'B':{'A':{'inter': 'ppi'}},'B':{'D':{'inter':
> 'ppi'}},'D':{'B':{'inter': 'ppi'}},'E':{'B':{'inter':
> 'ppi'}},'A':{'B':{'inter': 'ppi'}},'B':{'E':{'inter': 'ppi'}}}
> G =
> nx.from_dict_of_dicts(gtest,create_using=nx.MultiDiGraph(),multigraph_input=True)
>
> Result:
> Traceback (most recent call last):
> File "centralidades.py", line 12, in <module>
> G =
> nx.from_dict_of_dicts(gteste,create_using=nx.MultiDiGraph(),multigraph_input=True)
> File
> "/usr/local/lib/python2.6/dist-packages/networkx-1.0.1-py2.6.egg/networkx/convert.py",
> line 324, in from_dict_of_dicts
> File
> "/usr/local/lib/python2.6/dist-packages/networkx-1.0.1-py2.6.egg/networkx/classes/multigraph.py",
> line 350, in add_edges_from
> ValueError: dictionary update sequence element #0 has length 1; 2 is
> required
I think this should work - I'll look into it.
Aric