classes.py 文件源码

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

项目:binet 作者: crisjf 项目源码 文件源码
def set_node_attributes(self,side,name,values):
        '''
        Set node of type side attributes from dictionary of nodes and values.
        Only sets one attribute at a time.

        Parameters
        ----------
        name  : string
            Attribute name
        side  : int or str
            Tags for each side of the bipartite network.
        values: dict
            Dictionary of attribute values keyed by node. 
            Nodes that do not belong to side will not be considered.
        '''
        self._check_side(side)
        ns   = set(values.keys()).intersection(set(self.nodes(side)))
        vals = {val:values[val] for val in ns}
        set_node_attributes(self,name,vals)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号