class_docstr: Accepts or displays 2D input through a spreadsheet-like component for dataframes.
  Preprocessing: passes the uploaded spreadsheet data as a {pandas.DataFrame}, {numpy.array}, or {List[List]} depending on `type`
  Postprocessing: expects a {pandas.DataFrame}, {pandas.Styler}, {numpy.array}, {List[List]}, {List}, a {Dict} with keys `data` (and optionally `headers`), or {str} path to a csv, which is rendered in the spreadsheet.
  Examples-format: a {str} filepath to a csv with data, a pandas dataframe, or a list of lists (excluding headers) where each sublist is a row of data.
  Demos: filter_records, matrix_transpose, tax_calculator
code: def preprocess(
      self, payload: DataframeData
  ) -> pd.DataFrame | np.ndarray | list:
      if self.type == "pandas":
          if payload.headers is not None:
              return pd.DataFrame(payload.data, columns=payload.headers)
          else:
              return pd.DataFrame(payload.data)
      if self.type == "numpy":
          return np.array(payload.data)
      elif self.type == "array":
          return payload.data
      else:
          raise ValueError(
              "Unknown type: "
              + str(self.type)
              + ". Please choose from: 'pandas', 'numpy', 'array'."
          )
  
imports: from __future__ import annotations
  import warnings
  from typing import Any, Callable, Dict, List, Literal, Optional
  import numpy
  import pandas
  import semantic_version
  from gradio_client.documentation import document, set_documentation_group
  from pandas.io.formats.style import Styler
  from gradio.components import Component
  from gradio.data_classes import GradioModel
  from gradio.events import Events
label_desc: Use image node_id 2 for calling the Dataframe obj's underlying member method code with example usage: obj.preprocess(payload) and returns: np, pd, pd, payload