API Reference

This section provides a detailed overview of deepgraph’s core functionality, including the DeepGraph class, its methods for graph construction, partitioning, interfacing with other network packages, visualization, as well as various utility functions.

Additionally, you will find a decorator to facilitate the use of user-defined connector and selector functions when creating edges.

The DeepGraph class

DeepGraph([v, e, supernode_labels_by, ...])

The core class of DeepGraph (dg).

Creating Edges

DeepGraph.create_edges([connectors, ...])

Create an edge table e linking the nodes in v.

DeepGraph.create_edges_ft(ft_feature[, ...])

Create (ft) an edge table e linking the nodes in v.

Graph Partitioning

DeepGraph.partition_nodes(features[, ...])

Return a supernode DataFrame sv.

DeepGraph.partition_edges([relations, ...])

Return a superedge DataFrame se.

DeepGraph.partition_graph(features[, ...])

Return supergraph DataFrames sv and se.

Graph Interfaces

DeepGraph.return_cs_graph([relations, dropna])

Return scipy.sparse.coo_matrix representation(s).

DeepGraph.return_nx_graph([features, ...])

Return a networkx.DiGraph representation.

DeepGraph.return_nx_multigraph([features, ...])

Return a networkx.MultiDiGraph representation.

DeepGraph.return_gt_graph([features, ...])

Return a graph_tool.Graph representation.

Plotting Methods

DeepGraph.plot_2d(x, y[, edges, C, ...])

Plot nodes and corresponding edges in 2 dimensions.

DeepGraph.plot_2d_generator(x, y, by[, ...])

Plot nodes and corresponding edges by groups.

DeepGraph.plot_map(lon, lat[, edges, C, ...])

Plot nodes and corresponding edges on a basemap.

DeepGraph.plot_map_generator(lon, lat, by[, ...])

Plot nodes and corresponding edges by groups, on basemaps.

DeepGraph.plot_hist(x[, bins, log_bins, ...])

Plot a histogram (or pdf) of x.

DeepGraph.plot_logfile(logfile)

Plot a logfile.

Other Methods

DeepGraph.append_binning_labels_v(col, col_name)

Append a column with binning labels of the values in v[col].

DeepGraph.append_cp([directed, connection, ...])

Append a component membership column to v.

DeepGraph.filter_by_values_v(col, values)

Keep only nodes in v with features of type col in values.

DeepGraph.filter_by_values_e(col, values)

Keep only edges in e with relations of type col in values.

DeepGraph.filter_by_interval_v(col, interval)

Keep only nodes in v with features of type col in interval.

DeepGraph.filter_by_interval_e(col, interval)

Keep only edges in e with relations of type col in interval.

DeepGraph.update_edges()

After removing nodes in v, update e.

The deepgraph.output_names Decorator

output_names(*names)

Decorator to specify the output variable names of a connector or selector function.