cugraph.experimental.PropertyGraph#

class cugraph.experimental.PropertyGraph(*args, **kwargs)[source]#

Class which stores vertex and edge properties that can be used to construct Graphs from individual property selections and used later to annotate graph algorithm results with corresponding properties.

__init__(*args, **kwargs)[source]#

Methods

__init__(*args, **kwargs)

add_edge_data(dataframe, vertex_col_names[, ...])

Add a dataframe describing edge properties to the PropertyGraph.

add_vertex_data(dataframe, vertex_col_name)

Add a dataframe describing vertex properties to the PropertyGraph.

annotate_dataframe(df, G, edge_vertex_col_names)

Add properties to df that represent the vertices and edges in graph G.

edge_props_to_graph(edge_prop_df, create_using)

Create a Graph from the edges in edge_prop_df.

edge_types_from_numerals(nums)

Returns the string edge type names given the numeric category labels.

edge_vector_property_to_array(df, col_name)

Convert a known edge vector property in a DataFrame to an array.

extract_subgraph([create_using, selection, ...])

Return a subgraph of the overall PropertyGraph containing vertices and edges that match a selection.

fillna_edges([val])

Fills empty edge property values with the given value, zero by default.

fillna_vertices([val])

Fills empty vertex property values with the given value, zero by default.

get_edge_data([edge_ids, types, columns])

Return a dataframe containing edge properties for only the specified edge_ids, columns, and/or edge type, or all edge IDs if not specified.

get_num_edges([type])

Return the number of all edges or edges of a given type.

get_num_vertices([type, include_edge_data])

Return the number of all vertices or vertices of a given type.

get_vertex_data([vertex_ids, types, columns])

Gets a DataFrame containing vertex properties

get_vertices([selection])

Return a Series containing the unique vertex IDs contained in both the vertex and edge property data in ascending order.

has_duplicate_edges(df[, columns])

Return True if df has rows with the same src, dst, type, and columns

is_multi_gpu()

Return True if this is a multi-gpu graph.

is_multigraph(df)

Parameters:

renumber_edges_by_type([prev_id_column])

Renumber edge IDs to be contiguous by type.

renumber_vertices_by_type([prev_id_column])

Renumber vertex IDs to be contiguous by type.

select_edges(expr)

Evaluate expr and return a PropertySelection object representing the edges that match the expression selection criteria.

select_vertices(expr[, from_previous_selection])

Evaluate expr and return a PropertySelection object representing the vertices that match the expression.

vertex_types_from_numerals(nums)

Returns the string vertex type names given the numeric category labels.

vertex_vector_property_to_array(df, col_name)

Convert a known vertex vector property in a DataFrame to an array.

vertices_ids()

Alias for get_vertices()

Attributes

dst_col_name

Column containing the id of the edge destination

edge_id_col_name

Column containing the edge identifier

edge_property_names

List containing each edge property name in the PropertyGraph instance.

edge_types

Series containing the set of edge type names

edges

All the edges in the graph as a DataFrame containing sources and destinations.

src_col_name

Column containing the id of the edge source

type_col_name

Column containing the type of the edge or vertex

vertex_col_name

Column containing the vertex id.

vertex_property_names

Names of all the vertex properties excluding type.

vertex_types

The set of vertex type names

weight_col_name

Column containing the edge weight if the graph is weighted.