deepgraph.DeepGraph.return_gt_graph
- DeepGraph.return_gt_graph(features=False, relations=False, dropna='none', node_indices=False, edge_indices=False)[source]
Return a
graph_tool.Graphrepresentation.Create a
graph_tool.Graph(directed) representation 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. If the nodes invare not indexed by consecutive integers starting from 0, one may internalize the original node and edge indices as propertymaps by settingnode_indicesand/oredge_indicesto True.- Parameters:
features (bool, str, or array_like, optional (default=False)) – Indicates which types of features to internalize as
graph_tool.PropertyMap. Can be column name(s) ofv, False or True. If False, create no propertymaps. If True, create propertymaps for every column inv. If str or array_like, must be column name(s) ofvindicating which types of features to internalize.relations (bool, str, or array_like, optional (default=False)) – Indicates which types of relations to internalize as
graph_tool.PropertyMap. Can be column name(s) ofe, False or True. If False, create no propertymaps (all edges ine.indexare transferred, regardless ofdropna). If True, create propertymaps 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 internalize (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.node_indices (bool, optional (default=False)) – If True, internalize a vertex propertymap
iwith the original node indices.edge_indices (bool, optional (default=False)) – If True, internalize edge propertymaps
sandtwith the original source and target node indices of the edges, respectively.
- Returns:
gt_g
- Return type:
graph_tool.Graph
See also
Notes
If the index of
vis not pd.RangeIndex(start=0,stop=len(v), step=1), the indices will be enumerated, which is expensive for large graphs.