utils.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:teneto 作者: wiheto 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号