Skip to main content

Class wandb.Table

The Table class used to display and analyze tabular data. Unlike traditional spreadsheets, Tables support numerous types of data: scalar values, strings, numpy arrays, and most subclasses of wandb.data_types.Media. This means you can embed Images, Video, Audio, and other sorts of rich, annotated media directly in Tables, alongside other traditional scalar values. This class is the primary class used to generate W&B Tables https://docs.wandb.ai/models/tables

Args

list[ColumnKey] | None
Names of the columns in the table. Defaults to [“Input”, “Output”, “Expected”].
list[InputRow] | np.ndarray | pd.DataFrame | None
2D row-oriented array of values, NumPy array, or pandas DataFrame.
list[InputRow] | None
2D row-oriented array of values.
pd.DataFrame | None
pandas DataFrame object used to create the table. When set, data and columns arguments are ignored.
Any
The expected type for the column values, used to validate the data. If not set, types are inferred from the data. It can be:
  • a single type
    • a Python built-in type such as int, str, bool, list, dict, or datetime.
    • a W&B Media type like wandb.Image declared under wandb.data_types
    • a const value
  • a list of any of the above to assign a different type to each column (should be the same length as columns)
bool | list[bool]
Determines if None values are allowed. Defaults to True.
  • If a singular bool value, then the optionality is enforced for all columns specified at construction time
  • If a list of bool values, then the optionality is applied to each column - should be the same length as columns applies to all columns. A list of bool values applies to each respective column.
bool
Determines if columns are allowed to have mixed types (disables type validation). Defaults to False
LogMode | None
Controls how the Table is logged when mutations occur. Options:
  • “IMMUTABLE” (default): Table can only be logged once; subsequent logging attempts after the table has been mutated will be no-ops.
  • “MUTABLE”: Table can be re-logged after mutations, creating a new artifact version each time it’s logged.
  • “INCREMENTAL”: Table data is logged incrementally, with each log creating a new artifact entry containing the new data since the last log.