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)
评论列表
文章目录