deepgraph.DeepGraph.return_nx_graph
- DeepGraph.return_nx_graph(features=False, relations=False, dropna='none')[source]
Return a
networkx.DiGraphrepresentation.Create a
networkx.DiGraphrepresentation of the graph given byvande. Node and edge properties to transfer can be indicated by thefeaturesandrelationsinput arguments. Whether to drop edges with NA values in the subset of types of relations given byrelationscan 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 types of relations to transfer as edge attributes. Can be column name(s) of
e, False or True. If False, create no edge attributes (all edges ine.indexare transferred, regardless ofdropna). If True, create edge attributes for every column ine(all edges ine.indexare transferred, regardless ofdropna). If str or array_like, must be column name(s) ofeindicating which types of relations to transfer (which edges are transferred can be controlled bydropna).dropna (str, optional (default='none')) – One of {‘none’,’any’,’all’}. If ‘none’, all edges in
e.indexare transferred. If ‘any’, drop all edges (rows) ine[relations]where any NA values are present. If ‘all’, drop all edges (rows) ine[relations]where all values are NA. Only has an effect ifrelationsis str or array_like.
- Returns:
nx_g
- Return type:
networkx.DiGraph
See also