def set_diagonal(G, val=0):
"""
Generally diagonal is set to 0. This function helps set the diagonal across time.
**PARAMETERS**
:G: temporal network (graphlet)
:val: value to set diagonal to (default 0).
**OUTPUT**
:G: Graphlet representation of G with new diagonal
**HISTORY**
:Modified: Dec 2016, WHT (documentation)
:Created: Nov 2016, WHT
"""
for t in range(0, G.shape[2]):
np.fill_diagonal(G[:, :, t], val)
return G
评论列表
文章目录