class_docstr: The condensed tree structure, which provides a simplified or smoothed version
  of the :class:`~hdbscan.plots.SingleLinkageTree`.
  
  Parameters
  ----------
  condensed_tree_array : numpy recarray from :class:`~hdbscan.HDBSCAN`
      The raw numpy rec array version of the condensed tree as produced
      internally by hdbscan.
  
  cluster_selection_method : string, optional (default 'eom')
      The method of selecting clusters. One of 'eom' or 'leaf'
  
  allow_single_cluster : Boolean, optional (default False)
      Whether to allow the root cluster as the only selected cluster
class_docstr_tok: ["The","condensed","tree","structure",",","which","provides","a","simplified","or","smoothed","version","of","the",":","class",":","`","~hdbscan.plots.SingleLinkageTree","`",".","Parameters","--","--","--","--","--","condensed_tree_array",":","numpy","recarray","from",":","class",":","`","~hdbscan.HDBSCAN","`","The","raw","numpy","rec","array","version","of","the","condensed","tree","as","produced","internally","by","hdbscan",".","cluster_selection_method",":","string",",","optional","(","default","'eom","'",")","The","method","of","selecting","clusters",".","One","of","'eom","'","or","'leaf'","allow_single_cluster",":","Boolean",",","optional","(","default","False",")","Whether","to","allow","the","root","cluster","as","the","only","selected","cluster"]
docstr: Return a NetworkX DiGraph object representing the condensed tree.
  
  Edge weights in the graph are the lamba values at which child nodes
  'leave' the parent cluster.
  
  Nodes have a `size` attribute attached giving the number of points
  that are in the cluster (or 1 if it is a singleton point) at the
  point of cluster creation (fewer points may be in the cluster at
  larger lambda values).
docstr_tok: ["Return","a","NetworkX","DiGraph","object","representing","the","condensed","tree",".","Edge","weights","in","the","graph","are","the","lamba","values","at","which","child","nodes","'leave","'","the","parent","cluster",".","Nodes","have","a","`","size","`","attribute","attached","giving","the","number","of","points","that","are","in","the","cluster","(","or","1","if","it","is","a","singleton","point",")","at","the","point","of","cluster","creation","(","fewer","points","may","be","in","the","cluster","at","larger","lambda","values",")","."]
code: def to_networkx(self):
      """Return a NetworkX DiGraph object representing the condensed tree.
  
      Edge weights in the graph are the lamba values at which child nodes
      'leave' the parent cluster.
  
      Nodes have a `size` attribute attached giving the number of points
      that are in the cluster (or 1 if it is a singleton point) at the
      point of cluster creation (fewer points may be in the cluster at
      larger lambda values).
      """
      try:
          from networkx import DiGraph, set_node_attributes
      except ImportError:
          raise ImportError(
              "You must have networkx installed to export networkx graphs"
          )
  
      result = DiGraph()
      for row in self._raw_tree:
          result.add_edge(
              row["parent"], row["child"], weight=row["lambda_val"]
          )
  
      set_node_attributes(
          result, dict(self._raw_tree[["child", "child_size"]]), "size"
      )
  
      return result
  
imports: import numpy
  from scipy.cluster.hierarchy import dendrogram
  from sklearn.manifold import TSNE
  from sklearn.decomposition import PCA
  from sklearn.metrics import pairwise_distances
  from warnings import warn
  from ._hdbscan_tree import compute_stability, labelling_at_cut, recurse_leaf_dfs
label_desc: Use image node_id 7 for calling the CondensedTree obj's underlying member method code with example usage: obj.to_networkx() and returns: result