class_docstr: 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.
class_docstr_tok: ["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","."]
docstr: Renumber vertex IDs to be contiguous by type.
  
  Parameters
  ----------
  prev_id_column : str, optional
      Column name to save the vertex ID before renumbering.
  
  Returns
  -------
  a DataFrame with the start and stop IDs for each vertex type.
  Stop is *inclusive*.
  
  Examples
  --------
  >>> import cugraph
  >>> import cudf
  >>> import cudf
  >>> from cugraph.experimental import PropertyGraph
  >>> df = cudf.DataFrame(columns=["src", "dst", "some_property"],
  ...                     data=[(99, 22, "a"),
  ...                           (98, 34, "b"),
  ...                           (97, 56, "c"),
  ...                           (96, 88, "d"),
  ...                          ])
  >>> pG = PropertyGraph()
  >>> pG.add_edge_data(df, type_name="etype", vertex_col_names=("src", "dst"))
  >>> vert_df1 = cudf.DataFrame({"vert_id": [99, 22, 98, 34],
  ...                            "v_prop": [1 ,2 ,3, 4]})
  >>> pG.add_vertex_data(vert_df1, type_name="vtype1", vertex_col_name="vert_id")
  >>> vert_df2 = cudf.DataFrame({"vert_id": [97, 56, 96, 88],
  ...                            "v_prop": [ 5, 6, 7, 8]})
  >>> pG.add_vertex_data(vert_df2, type_name="vtype2", vertex_col_name="vert_id")
  >>> pG.renumber_vertices_by_type()
          start  stop
  vtype1      0     3
  vtype2      4     7
code: def renumber_vertices_by_type(self, prev_id_column=None):
      """
      Renumber vertex IDs to be contiguous by type.
  
      Parameters
      ----------
      prev_id_column : str, optional
          Column name to save the vertex ID before renumbering.
  
      Returns
      -------
      a DataFrame with the start and stop IDs for each vertex type.
      Stop is *inclusive*.
  
      Examples
      --------
      >>> import cugraph
      >>> import cudf
      >>> import cudf
      >>> from cugraph.experimental import PropertyGraph
      >>> df = cudf.DataFrame(columns=["src", "dst", "some_property"],
      ...                     data=[(99, 22, "a"),
      ...                           (98, 34, "b"),
      ...                           (97, 56, "c"),
      ...                           (96, 88, "d"),
      ...                          ])
      >>> pG = PropertyGraph()
      >>> pG.add_edge_data(df, type_name="etype", vertex_col_names=("src", "dst"))
      >>> vert_df1 = cudf.DataFrame({"vert_id": [99, 22, 98, 34],
      ...                            "v_prop": [1 ,2 ,3, 4]})
      >>> pG.add_vertex_data(vert_df1, type_name="vtype1", vertex_col_name="vert_id")
      >>> vert_df2 = cudf.DataFrame({"vert_id": [97, 56, 96, 88],
      ...                            "v_prop": [ 5, 6, 7, 8]})
      >>> pG.add_vertex_data(vert_df2, type_name="vtype2", vertex_col_name="vert_id")
      >>> pG.renumber_vertices_by_type()
              start  stop
      vtype1      0     3
      vtype2      4     7
      """
      # Check if some vertex IDs exist only in edge data
      TCN = self.type_col_name
      default = self._default_type_name
      if (
          self.__edge_prop_dataframe is not None
          and self.get_num_vertices(default, include_edge_data=True)
          != self.get_num_vertices(default, include_edge_data=False)
      ):
          raise NotImplementedError(
              "Currently unable to renumber vertices when some vertex "
              "IDs only exist in edge data"
          )
      if self.__vertex_prop_dataframe is None:
          return None
      if (
          prev_id_column is not None
          and prev_id_column in self.__vertex_prop_dataframe
      ):
          raise ValueError(
              f"Can't save previous IDs to existing column {prev_id_column!r}"
          )
  
      # Use categorical dtype for the type column
      if self.__series_type is cudf.Series:
          cat_class = cudf.CategoricalDtype
      else:
          cat_class = pd.CategoricalDtype
  
      is_cat = isinstance(
          self.__vertex_prop_dataframe.dtypes[TCN], cat_class
      )
      if not is_cat:
          cat_dtype = cat_class([TCN], ordered=False)
          self.__vertex_prop_dataframe[
              TCN
          ] = self.__vertex_prop_dataframe[TCN].astype(cat_dtype)
  
      index_dtype = self.__vertex_prop_dataframe.index.dtype
      df = self.__vertex_prop_dataframe.reset_index()
      if (
          len(df.dtypes[TCN].categories) > 1
          and len(self.vertex_types) > 1
      ):
          # Avoid `sort_values` if we know there is only one type
          # `self.vertex_types` is currently not cheap, b/c it looks at edge df
          df = df.sort_values(by=TCN, ignore_index=True)
      df.index = df.index.astype(index_dtype)
      if self.__edge_prop_dataframe is not None:
          mapper = self.__series_type(
              df.index, index=df[self.vertex_col_name]
          )
          self.__edge_prop_dataframe[
              self.src_col_name
          ] = self.__edge_prop_dataframe[self.src_col_name].map(mapper)
          self.__edge_prop_dataframe[
              self.dst_col_name
          ] = self.__edge_prop_dataframe[self.dst_col_name].map(mapper)
      if prev_id_column is None:
          df.drop(columns=[self.vertex_col_name], inplace=True)
      else:
          df.rename(
              columns={self.vertex_col_name: prev_id_column},
              inplace=True,
          )
      df.index.name = self.vertex_col_name
      self.__vertex_prop_dataframe = df
      rv = (
          self._vertex_type_value_counts.sort_index()
          .cumsum()
          .to_frame("stop")
      )
      rv["start"] = rv["stop"].shift(1, fill_value=0)
      rv["stop"] -= 1  # Make inclusive
      return rv[["start", "stop"]]
  
imports: import cudf
  import numpy
  import cugraph
  from cugraph.utilities.utils import import_optional, MissingModule, create_list_series_from_2d_ar
  from typing import Union
label_desc: Use image node_id 30 for calling the EXPERIMENTAL__PropertyGraph obj's underlying member method code with example usage: obj.renumber_vertices_by_type(prev_id_column) and returns: rv, None