docstr: Return a Pandas dataframe of the minimum spanning tree.
  
  Each row is an edge in the tree; the columns are `from`,
  `to`, and `distance` giving the two vertices of the edge
  which are indices into the dataset, and the distance
  between those datapoints.
docstr_tok: ["Return","a","Pandas","dataframe","of","the","minimum","spanning","tree",".","Each","row","is","an","edge","in","the","tree",";","the","columns","are","`","from","`",",","`","to","`",",","and","`","distance","`","giving","the","two","vertices","of","the","edge","which","are","indices","into","the","dataset",",","and","the","distance","between","those","datapoints","."]
code: def to_pandas(self):
      """Return a Pandas dataframe of the minimum spanning tree.
  
      Each row is an edge in the tree; the columns are `from`,
      `to`, and `distance` giving the two vertices of the edge
      which are indices into the dataset, and the distance
      between those datapoints.
      """
      try:
          from pandas import DataFrame
      except ImportError:
          raise ImportError(
              "You must have pandas installed to export pandas DataFrames"
          )
  
      result = DataFrame(
          {
              "from": self._mst.T[0].astype(int),
              "to": self._mst.T[1].astype(int),
              "distance": self._mst.T[2],
          }
      )
      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 4 for calling the MinimumSpanningTree obj's underlying member method code with example usage: obj.to_pandas() and returns: result