cugraph.Graph.unrenumber#

Graph.unrenumber(df, column_name, preserve_order=False, get_column_names=False)[source]#

Given a DataFrame containing internal vertex ids in the identified column, replace this with external vertex ids. If the renumbering is from a single column, the output dataframe will use the same name for the external vertex identifiers. If the renumbering is from a multi-column input, the output columns will be labeled 0 through n-1 with a suffix of _column_name. Note that this function does not guarantee order in single GPU mode, and does not guarantee order or partitioning in multi-GPU mode. If you wish to preserve ordering, add an index column to df and sort the return by that index column.

Parameters:
df: cudf.DataFrame or dask_cudf.DataFrame

A DataFrame containing internal vertex identifiers that will be converted into external vertex identifiers.

column_name: string

Name of the column containing the internal vertex id.

preserve_order: bool, optional (default=False)

If True, preserve the order of the rows in the output DataFrame to match the input DataFrame

get_column_names: bool, optional (default=False)

If True, the unrenumbered column names are returned.

Returns:
dfcudf.DataFrame or dask_cudf.DataFrame

The original DataFrame columns exist unmodified. The external vertex dentifiers are added to the DataFrame, the internal vertex identifier column is removed from the dataframe.