cugraph.structure.graph_implementation.simpleGraphImpl.out_degree#
- simpleGraphImpl.out_degree(vertex_subset: Optional[Union[Series, Iterable]] = None) DataFrame [source]#
Compute vertex out-degree. Vertex out-degree is the number of edges pointing out from the vertex. By default, this method computes vertex degrees for the entire set of vertices. If vertex_subset is provided, this method optionally filters out all but those listed in vertex_subset.
- Parameters:
- vertex_subsetcudf.Series or iterable container, optional
A container of vertices for displaying corresponding out-degree. If not set, degrees are computed for the entire set of vertices.
- Returns:
- dfcudf.DataFrame
GPU DataFrame of size N (the default) or the size of the given vertices (vertex_subset) containing the out_degree. The ordering is relative to the adjacency list, or that given by the specified vertex_subset.
- df[vertex]cudf.Series
The vertex IDs (will be identical to vertex_subset if specified).
- df[degree]cudf.Series
The computed out-degree of the corresponding vertex.
Examples
>>> M = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ', ... dtype=['int32', 'int32', 'float32'], header=None) >>> G = cugraph.Graph() >>> G.from_cudf_edgelist(M, '0', '1') >>> df = G.out_degree([0,9,12])