![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Network Modeling
weixin_45405128
stay hungry, stay foolish.
展开
-
scipy.sparse.coo_matrix 稀疏矩阵存储数据
# Constructing an empty matrixfrom scipy.sparse import coo_matrixcoo_matrix((3, 4), dtype=np.int8).toarray()array([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=int8)row = n...原创 2019-10-17 13:07:27 · 311 阅读 · 0 评论 -
Bipartite Network.
import networkx as nximport numpy as npimport matplotlib.pyplot as pltB=nx.Graph()B.add_nodes_from(range(1,6,1),color='k')B.add_nodes_from(['A','B','C','D'],color='w')B.add_edges_from([(1,'A')...原创 2019-09-17 18:14:31 · 1397 阅读 · 0 评论 -
To draw network in python
1. draw a simple networkimport networkx as nximport numpy as npimport matplotlib.pyplot as pltA=np.array([[0,0,1,1,0], [1,0,0,0,1], [0,1,0,1,0], [0,1,0,0,0],...原创 2019-09-17 18:17:18 · 131 阅读 · 0 评论