code: def __init__(self, orig_edge_df):
      self.orig_edge_df = orig_edge_df
      self.id_node_df = pd.DataFrame(
          {
              "name": list(
                  set(orig_edge_df.source.values)
                  | set(orig_edge_df.target.values)
              )
          }
      )
      self.node_df = self.id_node_df.reset_index().set_index("name")
      self.edge_df = pd.merge(
          pd.merge(
              self.orig_edge_df,
              self.node_df,
              left_on="source",
              right_index=True,
          ).rename(columns={"index": "source_id"}),
          self.node_df,
          left_on="target",
          right_index=True,
      ).rename(columns={"index": "target_id"})
  
file_path: scattertext/scattertext/graphs/SimpleDiGraph.py
imports: import numpy
  import pandas
  from scipy.sparse import csr_matrix
  from scipy.sparse.csgraph._traversal import connected_components
  from scattertext.graphs.ComponentDiGraph import ComponentDiGraph
label_desc: Use image node_id 1 to create a new SimpleDiGraph object from inherited base classes: object with example: obj = SimpleDiGraph(orig_edge_df)