class_docstr: The performance class encapsulates the metrics that are recorded for
  configurations.
docstr: Returns a data frame representing the provided performances.
docstr_tok: ["Returns","a","data","frame","representing","the","provided","performances","."]
code: def to_dataframe(
      cls, performances: list[Performance], std: bool = True
  ) -> pd.DataFrame:
      """
      Returns a data frame representing the provided performances.
      """
      fields = sorted(
          Performance.__dataclass_fields__.keys()
      )  # pylint: disable=no-member
      result = np.empty((len(performances), 18 if std else 9))
  
      offset = 2 if std else 1
      for i, performance in enumerate(performances):
          for j, field in enumerate(fields):
              result[i, j * offset] = cast(
                  Metric, getattr(performance, field)
              ).mean
              if std:
                  result[i, j * offset + 1] = cast(
                      Metric, getattr(performance, field)
                  ).std
  
      return pd.DataFrame(
          result,
          columns=[
              f
              for field in fields
              for f in (
                  [f"{field}_mean", f"{field}_std"]
                  if std
                  else [f"{field}_mean"]
              )
          ],
      )
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/tsbench/evaluations/metrics/performance.py
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import cast, Dict, List, Union
  import numpy
  import pandas
  from .metric import Metric
label_desc: Use image node_id 3 for calling the Performance obj's underlying member method code with example usage: obj.to_dataframe(cls, performances, std) and returns: pd