code: def to_dataframe(self, drop_weights_below=0, whitelist=None):
          
          network_df_cols = ["pw0", "pw1", "weight"]
          if self.features:
              network_df_cols.append("features")
          network_df = pd.DataFrame(columns=network_df_cols)
          idx = 0
          edge_pathways = set()
          for (v0, v1), edge_obj in self.edges.items():
              if (edge_obj.weight > drop_weights_below and
                      (whitelist is None or (v0, v1) in whitelist)):
                  row = [self.__getitem__(v0),
                         self.__getitem__(v1),
                         edge_obj.weight]
                  edge_pathways.add(v0)
                  edge_pathways.add(v1)
                  if self.features:
                      features = edge_obj.features_to_string()
                      row.append(features)
                  network_df.loc[idx] = row
                  idx += 1  # faster to append by index.
          network_df = network_df.sort_values(by=["weight"],
                                              ascending=False)
          print("The pathway co-occurrence network "
                "contains {0} pathways.".format(
                  len(edge_pathways)))
          return network_df
docs: Conversion of the network to a pandas.DataFrame.
  
          Parameters
          -----------
          drop_weights_below : int (default=0)
            specify an edge weight threshold - remove all edges with weight
            below this value
          whitelist : [set|list](tup(int, int))|None (default=None)
            option to pass in a set/list of edge ids (tup(int, int)) that should
            be kept in the resulting dataframe
  
          Returns
          -----------
          pandas.DataFrame
            a pandas.DataFrame containing the network edge information.
            columns = [pw0, pw1, weight]. an additional "features" column is
            returned if this network is not an aggregate of multiple networks.