Skip to content
esc
Start typing to search the docs
Navigate Open

Send tables to Rerun

This page shows how to send tabular data (dataframes encoded as Arrow record batches) to the Rerun Viewer, where you can view and interact with it. These tables are listed in the Sources panel, next to your recordings. To persist a table on a catalog server instead, see Storing query results in catalog tables. To log a table as part of a recording, use rr.send_dataframe.

Overview

The send_table API sends tabular data to the Rerun Viewer. This is useful for:

  • Debugging data processing pipelines
  • Presenting structured data in a readable format
  • Sorting and filtering tables interactively

Prerequisites

  • Rerun SDK (Python)
  • PyArrow library
  • Pandas
  • NumPy

Which can be installed via:

pip install rerun-sdk[notebook] pyarrow pandas numpy

Basic usage

Connecting to the Viewer

from rerun.experimental import ViewerClient

# Connect to a running Rerun Viewer
client = ViewerClient.connect(url="rerun+http://127.0.0.1:9876/proxy")

Sending a simple table

import pyarrow as pa

# Create a record batch from a Python dictionary
record_batch = pa.RecordBatch.from_pydict({
    "id": [1, 2, 3],
    "url": [
        "https://www.rerun.io",
        "https://github.com/rerun-io/rerun",
        "https://crates.io/crates/rerun",
    ],
})

# Send the table to the viewer with an identifier
client.send_table("My Table", record_batch)

Using with Pandas dataframes

You can also send Pandas dataframes by converting them to a record batch:

import numpy as np
import pandas as pd

# Create a sample DataFrame
dates = pd.date_range("20230101", periods=6)
df = pd.DataFrame(
    np.random.default_rng(0).standard_normal((6, 4)),
    index=dates,
    columns=list("ABCD"),
)

# Convert to record batch and send to the viewer.
client.send_table("Pandas DataFrame", pa.RecordBatch.from_pandas(df))

Using in Jupyter notebooks

Rerun provides special support for Jupyter notebooks, see Embed Rerun in notebooks. Note that this API makes use of rr.notebook.Viewer:

import os

import pyarrow as pa
import rerun as rr

# Embed the widget JavaScript directly in the notebook instead of fetching it from app.rerun.io
os.environ["RERUN_NOTEBOOK_ASSET"] = "inline"

# Create and display the viewer
viewer = rr.notebook.Viewer(width="auto", height="auto")
viewer.display()

# Send table directly to the inline viewer
viewer.send_table(
    "My Table",
    pa.RecordBatch.from_pydict({"Column A": [1, 2, 3], "Column B": ["https://www.rerun.io", "Hello", "World"]}),
)

Current limitations

As this is an experimental API, there are several limitations to be aware of:

  • Multiple record batches (or a DataFusion DataFrame) can be passed, but they are merged into a single record batch before sending
  • Tables can't be saved to or loaded from files (unlike .rrd files for recordings)
  • Only the Python SDK can send tables; the Rust and C++ SDKs cannot

References

For complete examples of using send_table, please refer to: