deepgraph.deepgraph.DeepGraph.return_nx_graph¶
-
DeepGraph.
return_nx_graph
(features=False, relations=False, dropna='none')[source]¶ Return a
networkx.DiGraph
representation.Create a
networkx.DiGraph
representation of the graph given byv
ande
. Node and edge properties to transfer can be indicated by thefeatures
andrelations
input arguments. Whether to drop edges with NA values in the subset of types of relations given byrelations
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) ofv
indicating 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.index
are transferred, regardless ofdropna
). If True, create edge attributes for every column ine
(all edges ine.index
are transferred, regardless ofdropna
). If str or array_like, must be column name(s) ofe
indicating 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.index
are 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 ifrelations
is str or array_like.
Returns: nx_g
Return type: networkx.DiGraph
- 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