> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-sdk-add-methods-properties.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Table methods

## <Badge color="yellow" size="lg" shape="rounded">Class</Badge> wandb.Table

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Table.add\_column()

Adds a column of data to the table.

```python theme={null}
self,
name: 'str',
data: 'list[Any] | np.ndarray',
optional: 'bool' = False
```

##### Arguments

<ResponseField name="name" type="str">
  The unique name of the column.
</ResponseField>

<ResponseField name="data" type="list[Any] | np.ndarray">
  A column of homogeneous data.
</ResponseField>

<ResponseField name="optional" type="bool">
  If null-like values are permitted.
</ResponseField>

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Table.add\_computed\_columns()

Adds one or more computed columns based on existing data.

```python theme={null}
self,
fn: 'Callable[[int, dict[ColumnKey, Any]], dict[str, Any]]'
```

##### Arguments

<ResponseField name="fn" type="Callable[[int, dict[ColumnKey, Any]], dict[str, Any]]">
  A function which accepts an index and row dict, and returns a dict representing new columns for that row, keyed by the new column names.
</ResponseField>

##### Examples

table = wandb.Table(columns=\["x", "y"], data=\[\[3, 1], \[4, 6]])
table.add\_computed\_columns(
)

In the callback:

* `ndx` is an integer representing the index of the row.
* `row` is a dictionary keyed by existing columns.

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Table.add\_data()

Adds a new row of data to the table.

The maximum amount ofrows in a table is determined by
`wandb.Table.MAX_ARTIFACT_ROWS`.

The length of the data should match the length of the table column.

```python theme={null}
self, *data: 'Any'
```

##### Arguments

<ResponseField name="data" type="Any" />

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Table.add\_row()

Deprecated. Use `Table.add_data` method instead.

```python theme={null}
self, *row: 'Any'
```

##### Arguments

<ResponseField name="row" type="Any" />

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Table.cast()

Casts a column to a specific data type.

This can be one of the normal python classes, an internal W\&B type,
or an example object, like an instance of wandb.Image or
wandb.Classes.

```python theme={null}
self,
col_name: 'ColumnKey',
dtype: 'Any',
optional: 'bool' = False
```

##### Arguments

<ResponseField name="col_name" type="ColumnKey">
  The name of the column to cast.
</ResponseField>

<ResponseField name="dtype" type="Any">
  The target dtype.
</ResponseField>

<ResponseField name="optional" type="bool">
  If the column should allow Nones.
</ResponseField>

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Table.get\_column()

Retrieves a column from the table and optionally converts it to a NumPy object.

```python theme={null}
self,
name: 'ColumnKey',
convert_to: "Literal['numpy'] | None" = None
```

##### Arguments

<ResponseField name="name" type="ColumnKey">
  The name of the column.
</ResponseField>

<ResponseField name="convert_to" type="Literal['numpy'] | None">
  "numpy" will convert the underlying data to a NumPy object.
</ResponseField>

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Table.get\_dataframe()

Returns a `pandas.DataFrame` of the table.

```python theme={null}
self
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Table.get\_index()

Returns an array of row indexes for use in other tables to create links.

```python theme={null}
(self)
```
