class_docstr: A container for the nodes and labelled edges of a dependency structure.
docstr: Convert the data in a ``nodelist`` into a networkx labeled directed graph.
docstr_tok: ["Convert","the","data","in","a","``","nodelist","``","into","a","networkx","labeled","directed","graph","."]
code: def nx_graph(self):
      """Convert the data in a ``nodelist`` into a networkx labeled directed graph."""
      import networkx
  
      nx_nodelist = list(range(1, len(self.nodes)))
      nx_edgelist = [
          (n, self._hd(n), self._rel(n))
          for n in nx_nodelist
          if self._hd(n)
      ]
      self.nx_labels = {}
      for n in nx_nodelist:
          self.nx_labels[n] = self.nodes[n]["word"]
  
      g = networkx.MultiDiGraph()
      g.add_nodes_from(nx_nodelist)
      g.add_edges_from(nx_edgelist)
  
      return g
  
imports: import subprocess
  import warnings
  from collections import defaultdict
  from itertools import chain
  from pprint import pformat
  from nltk.internals import find_binary
  from nltk.tree import Tree
label_desc: Use image node_id 26 for calling the DependencyGraph obj's underlying member method code with example usage: obj.nx_graph() and returns: g