PlanarEmbedding.remove_nodes_from#

PlanarEmbedding.remove_nodes_from(nodes)[source]#

Remove multiple nodes.

Parameters:
nodesiterable container

A container of nodes (list, dict, set, etc.). If a node in the container is not in the graph it is silently ignored.

See also

remove_node

Notes

When removing nodes from an iterator over the graph you are changing, a RuntimeError will be raised with message: RuntimeError: dictionary changed size during iteration. This happens when the graph’s underlying dictionary is modified during iteration. To avoid this error, evaluate the iterator into a separate object, e.g. by using list(iterator_of_nodes), and pass this object to G.remove_nodes_from.