When I run
H = xgi.Hypergraph()
node_dict = {0: {"name": "tom"}}
H.add_nodes_from(node_dict)
and run H.nodes[0], I get {}.
When I run
H = xgi.Hypergraph()
node_dict = {0: {"name": "tom"}}
H.add_nodes_from(node_dict)
H.set_node_attributes(node_dict)
and run H.nodes[0], I get {"name": "tom"}.
I think that add_nodes_from should have the same effect as running the second code snippen.
In the past, we've talked about limiting the number of input formats that we support, but I think that aside from a list/array of nodes to add, this is the second most useful option.
When I run
and run
H.nodes[0], I get{}.When I run
and run
H.nodes[0], I get{"name": "tom"}.I think that
add_nodes_fromshould have the same effect as running the second code snippen.In the past, we've talked about limiting the number of input formats that we support, but I think that aside from a list/array of nodes to add, this is the second most useful option.