docstr: 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 or partitioning in
  multi-GPU mode.
  
  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 ourder 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
  ---------
  df : cudf.DataFrame or dask_cudf.DataFrame
      The original DataFrame columns exist unmodified.  The external
      vertex identifiers are added to the DataFrame, the internal
      vertex identifier column is removed from the dataframe.
  
  column_names: string or list of strings
      If get_column_names is True, the unrenumbered column names are
      returned.
  
  Examples
  --------
  >>> from cugraph.structure import number_map
  >>> df = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ',
  ...                    dtype=['int32', 'int32', 'float32'],
  ...                    header=None)
  >>> df['0'] = df['0'].astype(str)
  >>> df['1'] = df['1'].astype(str)
  >>> df, number_map = number_map.NumberMap.renumber(df, '0', '1')
  >>> G = cugraph.Graph()
  >>> G.from_cudf_edgelist(df,
  ...                      number_map.renumbered_src_col_name,
  ...                      number_map.renumbered_dst_col_name)
  >>> pr = cugraph.pagerank(G, alpha = 0.85, max_iter = 500,
  ...                       tol = 1.0e-05)
  >>> pr = number_map.unrenumber(pr, 'vertex')
docstr_tok: ["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","or","partitioning","in","multi-GPU","mode",".","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","ourder","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","--","--","--","--","-","df",":","cudf.DataFrame","or","dask_cudf.DataFrame","The","original","DataFrame","columns","exist","unmodified",".","The","external","vertex","identifiers","are","added","to","the","DataFrame",",","the","internal","vertex","identifier","column","is","removed","from","the","dataframe",".","column_names",":","string","or","list","of","strings","If","get_column_names","is","True",",","the","unrenumbered","column","names","are","returned",".","Examples","--","--","--","--",">",">",">","from","cugraph.structure","import","number_map",">",">",">","df","=","cudf.read_csv","(","datasets_path","\/","'karate.csv","'",",","delimiter=","'","'",",","...","dtype=","[","'int32","'",",","'int32","'",",","'float32","'","]",",","...","header=None",")",">",">",">","df","[","'","0","'","]","=","df","[","'","0","'","]",".astype","(","str",")",">",">",">","df","[","'","1","'","]","=","df","[","'","1","'","]",".astype","(","str",")",">",">",">","df",",","number_map","=","number_map.NumberMap.renumber","(","df",",","'","0","'",",","'","1","'",")",">",">",">","G","=","cugraph.Graph","(",")",">",">",">","G.from_cudf_edgelist","(","df",",","...","number_map.renumbered_src_col_name",",","...","number_map.renumbered_dst_col_name",")",">",">",">","pr","=","cugraph.pagerank","(","G",",","alpha","=","0.85",",","max_iter","=","500",",","...","tol","=","1.0e-05",")",">",">",">","pr","=","number_map.unrenumber","(","pr",",","'vertex","'",")"]
code: def unrenumber(
      self,
      df,
      column_name,
      preserve_order=False,
      get_column_names=False,
  ):
      """
      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 or partitioning in
      multi-GPU mode.
  
      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 ourder 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
      ---------
      df : cudf.DataFrame or dask_cudf.DataFrame
          The original DataFrame columns exist unmodified.  The external
          vertex identifiers are added to the DataFrame, the internal
          vertex identifier column is removed from the dataframe.
  
      column_names: string or list of strings
          If get_column_names is True, the unrenumbered column names are
          returned.
  
      Examples
      --------
      >>> from cugraph.structure import number_map
      >>> df = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ',
      ...                    dtype=['int32', 'int32', 'float32'],
      ...                    header=None)
      >>> df['0'] = df['0'].astype(str)
      >>> df['1'] = df['1'].astype(str)
      >>> df, number_map = number_map.NumberMap.renumber(df, '0', '1')
      >>> G = cugraph.Graph()
      >>> G.from_cudf_edgelist(df,
      ...                      number_map.renumbered_src_col_name,
      ...                      number_map.renumbered_dst_col_name)
      >>> pr = cugraph.pagerank(G, alpha = 0.85, max_iter = 500,
      ...                       tol = 1.0e-05)
      >>> pr = number_map.unrenumber(pr, 'vertex')
  
      """
      if len(self.implementation.col_names) == 1:
          # Output will be renamed to match input
          mapping = {"0": column_name}
          col_names = column_name
      else:
          # Output will be renamed to ${i}_${column_name}
          mapping = {}
          for nm in self.implementation.col_names:
              mapping[nm] = nm + "_" + column_name
          col_names = list(mapping.values())
  
      if isinstance(self.input_src_col_names, list):
          input_src_col_names = self.input_src_col_names.copy()
          input_dst_col_names = self.input_dst_col_names.copy()
      else:
          # Assuming the src and dst columns are of the same length
          # if they are lists.
          input_src_col_names = [self.input_src_col_names]
          input_dst_col_names = [self.input_dst_col_names]
      if not isinstance(col_names, list):
          col_names = [col_names]
  
      if column_name in [
          self.renumbered_src_col_name,
          self.implementation.src_col_names,
      ]:
          self.internal_to_external_col_names.update(
              dict(zip(col_names, input_src_col_names))
          )
      elif column_name in [
          self.renumbered_dst_col_name,
          self.implementation.dst_col_names,
      ]:
          self.internal_to_external_col_names.update(
              dict(zip(col_names, input_dst_col_names))
          )
  
      if len(self.implementation.col_names) == 1:
          col_names = col_names[0]
  
      if preserve_order:
          index_name = NumberMap.generate_unused_column_name(df)
          df[index_name] = df.index
  
      df = self.from_internal_vertex_id(df, column_name, drop=True)
  
      if preserve_order:
          df = (
              df.sort_values(index_name)
              .drop(columns=index_name)
              .reset_index(drop=True)
          )
  
      if type(df) is dask_cudf.DataFrame:
          df = df.map_partitions(
              lambda df: df.rename(columns=mapping, copy=False)
          )
      else:
          df = df.rename(columns=mapping, copy=False)
      # FIXME: This parameter is not working as expected as it oesn't return
      # the unrenumbered column names: leverage 'self.internal_to_external_col_names'
      # instead.
      if get_column_names:
          return df, col_names
      else:
          return df
  
file_path: cugraph/python/cugraph/cugraph/structure/number_map.py
imports: from collections.abc import Iterable
  import dask_cudf
  import numpy
  import cudf
  import warnings
label_desc: Use image node_id 10 for calling the NumberMap obj's underlying member method code with example usage: obj.unrenumber(df, column_name, preserve_order, get_column_names) and returns: df,  col_names, df