wandb.data_types.Table

View source on GitHubarrow-up-right

This is a table designed to display sets of records.

Table(
    columns=None, data=None, rows=None, dataframe=None, dtype=None, optional=(True),
    allow_mixed_types=(False)
)

Arguments

columns

([str]) Names of the columns in the table. Defaults to ["Input", "Output", "Expected"].

data

(array) 2D Array of values that will be displayed as strings.

dataframe

(pandas.DataFrame) DataFrame object used to create the table. When set, the other arguments are ignored. optional (Union[bool,List[bool]]): If None values are allowed. Singular bool applies to all columns. A list of bool values applies to each respective column. Default to True. allow_mixed_types (bool): Determines if columns are allowed to have mixed types (disables type validation). Defaults to False

Methods

add_column

View sourcearrow-up-right

add_column(
    name, data, optional=(False)
)

Add a column of data to the table.

Arguments name: (str) - the unique name of the column data: (list | np.array) - a column of homogenous data optional: (bool) - if null-like values are permitted

add_computed_columns

View sourcearrow-up-right

Adds one or more computed columns based on existing data

Args

fn (function): A function which accepts one or two paramters: ndx (int) and row (dict) which is expected to return a dict representing new columns for that row, keyed by the new column names. - ndx is an integer representing the index of the row. Only included if include_ndx is set to true - row is a dictionary keyed by existing columns

add_data

View sourcearrow-up-right

Add a row of data to the table. Argument length should match column length

add_row

View sourcearrow-up-right

cast

View sourcearrow-up-right

Casts a column to a specific type

Arguments

col_name

(str) - name of the column to cast

dtype

(class, wandb.wandb_sdk.interface._dtypes.Type, any) - the target dtype. Can be one of normal python class, internal WB type, or an example object (eg. an instance of wandb.Image or wandb.Classes)

optional

(bool) - if the column should allow Nones

get_column

View sourcearrow-up-right

Retrieves a column of data from the table

Arguments name: (str) - the name of the column convert_to: (str, optional)

  • "numpy": will convert the underlying data to numpy object

get_index

View sourcearrow-up-right

Returns an array of row indexes which can be used in other tables to create links

index_ref

View sourcearrow-up-right

Get a reference to a particular row index in the table

iterrows

View sourcearrow-up-right

Iterate over rows as (ndx, row)

Yields

index : int The index of the row. Using this value in other WandB tables will automatically build a relationship between the tables row : List[any] The data of the row

set_fk

View sourcearrow-up-right

set_pk

View sourcearrow-up-right

Class Variables

MAX_ARTIFACT_ROWS

200000

MAX_ROWS

10000

Last updated