cugraph.structure.NumberMap.from_internal_vertex_id#

NumberMap.from_internal_vertex_id(df, internal_column_name=None, external_column_names=None, drop=False)[source]#

Given a collection of internal vertex ids, return a DataFrame of the external vertex ids

Parameters:
df: cudf.DataFrame, cudf.Series, dask_cudf.DataFrame, dask_cudf.Series

A list of internal vertex identifiers that will be converted into external vertex identifiers. If df is a series type object it will be converted to a dataframe where the series is in a column labeled ‘id’. If df is a dataframe type object then internal_column_name should identify which column corresponds the the internal vertex id that should be converted

internal_column_name: string, optional (default=None)

Name of the column containing the internal vertex id. If df is a series then this parameter is ignored. If df is a DataFrame this parameter is required.

external_column_names: string or list of str, optional (default=None)

Name of the columns that define an external vertex id. If not specified, columns will be labeled ‘0’, ‘1,’, …, ‘n-1’

drop: boolean, optional (default=False)

If True the internal column name will be dropped from the DataFrame.

Returns:
dfcudf.DataFrame or dask_cudf.DataFrame

The original DataFrame columns exist unmodified. Columns are added to the DataFrame to identify the external vertex identifiers. If external_columns is specified, these names are used as the names of the output columns. If external_columns is not specifed the columns are labeled ‘0’, … ‘n-1’ based on the number of columns identifying the external vertex identifiers.