deepgraph.DeepGraph.return_nx_multigraph
- DeepGraph.return_nx_multigraph(features=False, relations=False, dropna=True)[source]
Return a
networkx.MultiDiGraphrepresentation.Create a
networkx.MultiDiGraphrepresentation of the graph given byvande. As opposed toreturn_nx_graph, where every row ofeis treated as one edge, this method treats every cell ofeas one edge. The input argumentfeaturesindicates which node properties to transfer.relationsindicates which edges to transfer. Whether to drop edges with NA values can be controlled bydropna.Needs pandas >= 0.17.0.
- Parameters:
features (bool, str, or array_like, optional (default=False)) – Indicates which types of features to transfer as node attributes. Can be column name(s) of
v, False or True. If False, create no node attributes. If True, create node attributes for every column inv. If str or array_like, must be column name(s) ofvindicating which types of features to transfer.relations (bool, str, or array_like, optional (default=False)) – Indicates which cells of
eto transfer as edges. Can be False, True, or a (list of) column name(s) ofe. If False (default), all cells ofeare translated to edges, but their values are not transferred as edge attributes. If True, all cells ofeare translated, and their values are transferred as edge attributes. If str or array_like, must be column name(s) ofe, restricting the translation of cells to edges toe[relations](values are transferred as edge attributes).dropna (bool, optional (default=True)) – Whether to drop edges with NA values. Cells in
ewith NA values are not translated to edges.
- Returns:
nx_g
- Return type:
networkx.MultiDiGraph
See also