> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-style-guide-models-tables-20260604-114339.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Explore how to use W&B Tables with this 5-minute Quickstart.

# Tutorial: Log tables, visualize, and query data

export const ColabLink = ({url}) => <a href={url} target="_blank" rel="noopener noreferrer" className="colab-link">
    <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
      <path d="M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01.21.03zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z" />
    </svg>
    Try in Colab
  </a>;

Learn how to log data tables to W\&B, visualize them in your project workspace, and compare results across runs. By the end, you’ll have a logged table that you can explore and compare in W\&B.

Select the button below to try a PyTorch Quickstart example project on MNIST data.

<ColabLink url="https://colab.research.google.com/github/wandb/examples/blob/master/colabs/datasets-predictions/W%26B_Tables_Quickstart.ipynb" />

## Log a table

In this step, you create a table and log it to W\&B so that it's available for visualization later in the walkthrough. You can either construct a new table or pass a pandas DataFrame.

<Tabs>
  <Tab title="Construct a table">
    To construct and log a new table, use the following:

    * [`wandb.init()`](/models/ref/python/functions/init): Create a [run](/models/runs/) to track results.
    * [`wandb.Table()`](/models/ref/python/data-types/table): Create a new table object.
      * `columns`: Set the column names.
      * `data`: Set the contents of each row.
    * [`wandb.Run.log()`](/models/ref/python/experiments/run.md/#method-runlog): Log the table to save it to W\&B.

    Here's an example:

    ```python theme={null}
    import wandb

    with wandb.init(project="table-test") as run:
        # Create and log a new table.
        my_table = wandb.Table(columns=["a", "b"], data=[["a1", "b1"], ["a2", "b2"]])
        run.log({"Table Name": my_table})
    ```
  </Tab>

  <Tab title="Pandas DataFrame">
    Pass a pandas DataFrame to `wandb.Table()` to create a new table.

    ```python theme={null}
    import wandb
    import pandas as pd

    df = pd.read_csv("my_data.csv")

    with wandb.init(project="df-table") as run:
        # Create a new table from the DataFrame
        # and log it to W&B.
      my_table = wandb.Table(dataframe=df)
      run.log({"Table Name": my_table})
    ```

    For more information on supported data types, see the [`wandb.Table`](/models/ref/python/data-types/table) in the W\&B API Reference Guide.
  </Tab>
</Tabs>

## Visualize tables in your project workspace

After logging a table, you can view it in W\&B.

1. Navigate to your project in W\&B.
2. Select the name of your run in your project workspace. W\&B adds a new panel for each unique table key.

<Frame>
  <img src="https://mintcdn.com/wb-21fd5541-style-guide-models-tables-20260604-114339/eR3JYt8fgn_7Xm-p/images/data_vis/wandb_demo_logged_sample_table.png?fit=max&auto=format&n=eR3JYt8fgn_7Xm-p&q=85&s=cc15cdc41190e46a7971447cc8c55b0d" alt="Sample table logged" width="1762" height="880" data-path="images/data_vis/wandb_demo_logged_sample_table.png" />
</Frame>

In this example, `my_table` is logged under the key `"Table Name"`.

## Compare across model versions

After you have logged tables from more than one run, you can use the project workspace to compare results side by side and evaluate how model versions differ.

After you log tables from multiple W\&B runs, compare results side by side in the project workspace to evaluate differences between model versions. This [example workspace](https://wandb.ai/carey/table-test?workspace=user-carey) shows how to combine rows from multiple versions in the same table.

<Frame>
  <img src="https://mintcdn.com/wb-21fd5541-style-guide-models-tables-20260604-114339/eR3JYt8fgn_7Xm-p/images/data_vis/wandb_demo_toggle_on_and_off_cross_run_comparisons_in_tables.gif?s=8309ce28620a5330dd280fa808417884" alt="Cross-run table comparison" width="1754" height="1026" data-path="images/data_vis/wandb_demo_toggle_on_and_off_cross_run_comparisons_in_tables.gif" />
</Frame>

Use the table filter, sort, and grouping features to explore and evaluate model results.

<Frame>
  <img src="https://mintcdn.com/wb-21fd5541-style-guide-models-tables-20260604-114339/eR3JYt8fgn_7Xm-p/images/data_vis/wandb_demo_filter_on_a_table.png?fit=max&auto=format&n=eR3JYt8fgn_7Xm-p&q=85&s=b5f77cd50cc9ce88d338b2f6c3abb621" alt="Table filtering" width="1602" height="606" data-path="images/data_vis/wandb_demo_filter_on_a_table.png" />
</Frame>
