code: def pdToNx3(d, d2, c1, c2, eattr, n, nattr):
      G = nx.Graph()
      nds = d2[n].tolist()
      nattrs = d2[nattr].tolist()
      nodes = []
      for i in range(len(nds)):
          dicty = {"node_feature": float(nattrs[i])}
          t = (nds[i], dicty)
          nodes.append(t)
      G.add_nodes_from(nodes)
      src = d[c1].tolist()
      dst = d[c2].tolist()
      attr = d[eattr].tolist()
      edges = []
      for i in range(len(src)):
          currData = attr[i]
          if G.has_node(src[i]) and G.has_node(dst[i]):
              dicty = {
                  "edge_label": int(currData),
                  "edge_feature": float(1),
              }
              t = (src[i], dst[i], dicty)
              edges.append(t)
      G.add_edges_from(edges)
      return G
  
file_path: deepsnap/examples/bio_application/converter.py
imports: import pandas
  import networkx
  import torch
  import torch_geometric.data
  import torch_geometric.utils
label_desc: Use image node_id 7 for calling a global function with example usage: pdToNx3(d, d2, c1, c2, eattr, n, nattr) and returns: G