API Reference

The API reference summarizes DeepGraph’s core class, its methods and the functions subpackage.

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 Functions Module

deepgraph.functions Auxiliary connector and selector functions to create edges.

Connector Functions

great_circle_dist(lat_s, lat_t, lon_s, lon_t) Return the great circle distance between nodes.
cp_node_intersection(supernode_ids, sources, …) Work in progress!
cp_intersection_strength(n_unique_nodes, …) Work in progress!
hypergeometric_p_value(n_unique_nodes, …) Work in progress!

Selector Functions