nkoub / multinetx Goto Github PK
View Code? Open in Web Editor NEWmultiNetX is a python package for the manipulation and visualization of multilayer networks. It is build on NetworkX
multiNetX is a python package for the manipulation and visualization of multilayer networks. It is build on NetworkX
Hi ,
Using this code for MultilayerGraph from " https://github.com/InesCarrasco/multinetx/blob/master/classes/multilayer.py " is giving the error "TypeError: 'list' object cannot be interpreted as an integer" at pos = mx.get_position( ... )
Please advice.
in base/draw.py line 71:
it should be base_pos = nx.layout.circular_layout(G.get_layer(0))
not base_pos = nx.layout.circylar_layout(G.get_layer(0))
Hi Nikos,
Thanks for the awesome package.
I am trying to learn this tool using my own edgelists as input layers.
Here's my test:
cluster1 = nx.Graph()
cluster1.add_edges_from([
("A", "B"),
("A", "C"),
("B", "C")])
cluster2 = nx.Graph()
cluster2.add_edges_from([
("D", "E"),
("F", "E"),
("D", "F")])
clusts = mx.MultilayerGraph(list_of_layers=[cluster1,cluster1])
fig = plt.figure(figsize=(15,5))
ax1 = fig.add_subplot(121)
ax1.axis('off')
mx.draw_networkx(clusts,
# pos=pos1,
ax=ax1,
# labels={},
with_labels=True)
plt.show()
However I noticed the node labels converted into integers after mx.MultilayerGraph()
How can I label the nodes with original names as "A", "B", "C", et al.
Thank you very much!
Best, Tao
I am using the projection function on a MultilayerGraph object so that I can use the NetworkX modularity function in my code. In Python 3, has_key has been removed. As a result, line 179 (if multinet.edges.get(e).has_key("weight") and edge_weight:
) throws an attribute error even though multinet.edges.get(e)
does in fact yield a dictionary object, which in my case has weight as a key. Perhaps this part could be rewritten so that it is up to date with Python 3 conventions?
Loading and Saving (outside of .pkl) and to maintain the class structure of multinetx vs. fall back on networkx? @nkoub
I see multinetx requires networkx==2.3 but now 3.2.1 is available. Due to changes in some dependencies of networkx too, new python versions >3.9 have issues with old versions of networkx, which requires updating and that causes conflict with multinetx.
https://stackoverflow.com/questions/66174862/import-error-cant-import-name-gcd-from-fractions
Hello Sir,
I am facing problem while running the below given code of first example given for creating multilayer network. I have successfully installed the library.
import multinetx as mx
import numpy as np
g1 = mx.erdos_renyi_graph(100,0.5,seed=218)
g2 = mx.erdos_renyi_graph(100,0.6,seed=211)
g3 = mx.erdos_renyi_graph(100,0.7,seed=208)
adj_block = mx.lil_matrix(np.zeros((N3,N3)))
The error while runnnng above code is
g1 = mx.generators.erdos_renyi_graph(100,0.5,seed=218)
AttributeError: module 'multinetx' has no attribute 'generators'
Please help.
There may exist some indentations problems
Seems like there have to be equally many nodes in each layer. A generalization, aloowing different number of nodes would be nice.
Thanks for maintaining this excellent tool.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.