Skip to content

Dataframe

rerun.dataframe

AnyColumn: TypeAlias = Union[str, 'ComponentColumnDescriptor', 'ComponentColumnSelector', 'IndexColumnDescriptor', 'IndexColumnSelector'] module-attribute

A type alias for any column-like object.

AnyComponentColumn: TypeAlias = Union[str, 'ComponentColumnDescriptor', 'ComponentColumnSelector'] module-attribute

A type alias for any component-column-like object.

ComponentLike: TypeAlias = Union[str, Type['ComponentMixin']] module-attribute

A type alias for a component-like object used for content-expressions and column selectors.

This can be the name of the component as a string, or an instance of the component class itself. Strings are not required to be fully-qualified. Rerun will find the best-matching component based on the corresponding entity.

Examples:

  • "rerun.components.Position3D"
  • "Position3D"
  • rerun.components.Position3D

ViewContentsLike: TypeAlias = Union[str, Dict[str, Union[AnyColumn, Sequence[ComponentLike]]]] module-attribute

A type alias for specifying the contents of a view.

This can be a single string content-expression such as: "world/cameras/**", or a dictionary specifying multiple content-expressions and a respective list of components to select within that expression such as {"world/cameras/**": ["ImageBuffer", "PinholeProjection"]}.

class ComponentColumnDescriptor

The descriptor of a component column.

Component columns contain the data for a specific component of an entity.

Column descriptors are used to describe the columns in a Schema. They are read-only. To select a component column, use ComponentColumnSelector.

component_name: str property

The component name.

This property is read-only.

entity_path: str property

The entity path.

This property is read-only.

is_static: bool property

Whether the column is static.

This property is read-only.

class ComponentColumnSelector

A selector for a component column.

Component columns contain the data for a specific component of an entity.

component_name: str property

The component name.

This property is read-only.

entity_path: str property

The entity path.

This property is read-only.

def __init__(entity_path, component)

Create a new ComponentColumnSelector.

PARAMETER DESCRIPTION
entity_path

The entity path to select.

TYPE: str

component

The component to select

TYPE: ComponentLike

class IndexColumnDescriptor

The descriptor of an index column.

Index columns contain the index values for when the data was updated. They generally correspond to Rerun timelines.

Column descriptors are used to describe the columns in a Schema. They are read-only. To select an index column, use IndexColumnSelector.

is_static: bool property

Part of generic ColumnDescriptor interface: always False for Index.

def name()

The name of the index.

This property is read-only.

class IndexColumnSelector

A selector for an index column.

Index columns contain the index values for when the data was updated. They generally correspond to Rerun timelines.

def __init__(index)

Create a new IndexColumnSelector.

PARAMETER DESCRIPTION
index

The name of the index to select. Usually the name of a timeline.

TYPE: str

def name()

The name of the index.

This property is read-only.

class Recording

A single Rerun recording.

This can be loaded from an RRD file using load_recording().

A recording is a collection of data that was logged to Rerun. This data is organized as a column for each index (timeline) and each entity/component pair that was logged.

You can examine the .schema() of the recording to see what data is available, or create a RecordingView to to retrieve the data.

def application_id()

The application ID of the recording.

def recording_id()

The recording ID of the recording.

def schema()

The schema describing all the columns available in the recording.

def view(*, index, contents, include_semantically_empty_columns=False, include_indicator_columns=False, include_tombstone_columns=False)

Create a RecordingView of the recording according to a particular index and content specification.

The only type of index currently supported is the name of a timeline.

The view will only contain a single row for each unique value of the index that is associated with a component column that was included in the view. Component columns that are not included via the view contents will not impact the rows that make up the view. If the same entity / component pair was logged to a given index multiple times, only the most recent row will be included in the view, as determined by the row_id column. This will generally be the last value logged, as row_ids are guaranteed to be monotonically increasing when data is sent from a single process.

PARAMETER DESCRIPTION
index

The index to use for the view. This is typically a timeline name.

TYPE: str

contents

The content specification for the view.

This can be a single string content-expression such as: "world/cameras/**", or a dictionary specifying multiple content-expressions and a respective list of components to select within that expression such as {"world/cameras/**": ["ImageBuffer", "PinholeProjection"]}.

TYPE: ViewContentsLike

include_semantically_empty_columns

Whether to include columns that are semantically empty, by default False.

Semantically empty columns are components that are null or empty [] for every row in the recording.

TYPE: bool DEFAULT: False

include_indicator_columns

Whether to include indicator columns, by default False.

Indicator columns are components used to represent the presence of an archetype within an entity.

TYPE: bool DEFAULT: False

include_tombstone_columns

Whether to include tombstone columns, by default False.

Tombstone columns are components used to represent clears. However, even without the clear tombstone columns, the view will still apply the clear semantics when resolving row contents.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
RecordingView

The view of the recording.

Examples:

All the data in the recording on the timeline "my_index":

recording.view(index="my_index", contents="/**")

Just the Position3D components in the "points" entity:

recording.view(index="my_index", contents={"points": "Position3D"})

class RecordingView

A view of a recording restricted to a given index, containing a specific set of entities and components.

See Recording.view(…) for details on how to create a RecordingView.

Note: RecordingView APIs never mutate the underlying view. Instead, they always return new views with the requested modifications applied.

The view will only contain a single row for each unique value of the index that is associated with a component column that was included in the view. Component columns that are not included via the view contents will not impact the rows that make up the view. If the same entity / component pair was logged to a given index multiple times, only the most recent row will be included in the view, as determined by the row_id column. This will generally be the last value logged, as row_ids are guaranteed to be monotonically increasing when data is sent from a single process.

def fill_latest_at()

Populate any null values in a row with the latest valid data according to the index.

RETURNS DESCRIPTION
RecordingView

A new view with the null values filled in.

The original view will not be modified.

def filter_index_values(values)

Filter the view to only include data at the provided index values.

The index values returned will be the intersection between the provided values and the original index values.

This requires index values to be a precise match. Index values in Rerun are represented as i64 sequence counts or nanoseconds. This API does not expose an interface in floating point seconds, as the numerical conversion would risk false mismatches.

PARAMETER DESCRIPTION
values

The index values to filter by.

TYPE: IndexValuesLike

RETURNS DESCRIPTION
RecordingView

A new view containing only the data at the specified index values.

The original view will not be modified.

def filter_is_not_null(column)

Filter the view to only include rows where the given component column is not null.

This corresponds to rows for index values where this component was provided to Rerun explicitly via .log() or .send_columns().

PARAMETER DESCRIPTION
column

The component column to filter by.

TYPE: AnyComponentColumn

RETURNS DESCRIPTION
RecordingView

A new view containing only the data where the specified component column is not null.

The original view will not be modified.

def filter_range_nanos(start, end)

Filter the view to only include data between the given index values expressed as seconds.

This range is inclusive and will contain both the value at the start and the value at the end.

The view must be of a temporal index type to use this method.

PARAMETER DESCRIPTION
start

The inclusive start of the range.

TYPE: int

end

The inclusive end of the range.

TYPE: int

RETURNS DESCRIPTION
RecordingView

A new view containing only the data within the specified range.

The original view will not be modified.

def filter_range_seconds(start, end)

Filter the view to only include data between the given index values expressed as seconds.

This range is inclusive and will contain both the value at the start and the value at the end.

The view must be of a temporal index type to use this method.

PARAMETER DESCRIPTION
start

The inclusive start of the range.

TYPE: int

end

The inclusive end of the range.

TYPE: int

RETURNS DESCRIPTION
RecordingView

A new view containing only the data within the specified range.

The original view will not be modified.

def filter_range_sequence(start, end)

Filter the view to only include data between the given index sequence numbers.

This range is inclusive and will contain both the value at the start and the value at the end.

The view must be of a sequential index type to use this method.

PARAMETER DESCRIPTION
start

The inclusive start of the range.

TYPE: int

end

The inclusive end of the range.

TYPE: int

RETURNS DESCRIPTION
RecordingView

A new view containing only the data within the specified range.

The original view will not be modified.

def schema()

The schema describing all the columns available in the view.

This schema will only contain the columns that are included in the view via the view contents.

def select(*args, columns=None)

Select the columns from the view.

If no columns are provided, all available columns will be included in the output.

The selected columns do not change the rows that are included in the view. The rows are determined by the index values and the components that were included in the view contents, or can be overridden with .using_index_values().

If a column was not provided with data for a given row, it will be null in the output.

The output is a pyarrow.RecordBatchReader that can be used to read out the data.

PARAMETER DESCRIPTION
*args

The columns to select.

TYPE: AnyColumn DEFAULT: ()

columns

Alternatively the columns to select can be provided as a sequence.

TYPE: Optional[Sequence[AnyColumn]] DEFAULT: None

RETURNS DESCRIPTION
RecordBatchReader

A reader that can be used to read out the selected data.

def select_static(*args, columns=None)

Select only the static columns from the view.

Because static data has no associated index values it does not cause a row to be generated in the output. If your view only contains static data this method allows you to select it without needing to provide index values.

This method will always return a single row.

Any non-static columns that are included in the selection will generate a warning and produce empty columns.

PARAMETER DESCRIPTION
*args

The columns to select.

TYPE: AnyColumn DEFAULT: ()

columns

Alternatively the columns to select can be provided as a sequence.

TYPE: Optional[Sequence[AnyColumn]] DEFAULT: None

RETURNS DESCRIPTION
RecordBatchReader

A reader that can be used to read out the selected data.

def using_index_values(values)

Replace the index in the view with the provided values.

The output view will always have the same number of rows as the provided values, even if those rows are empty. Use with .fill_latest_at() to populate these rows with the most recent data.

This requires index values to be a precise match. Index values in Rerun are represented as i64 sequence counts or nanoseconds. This API does not expose an interface in floating point seconds, as the numerical conversion would risk false mismatches.

PARAMETER DESCRIPTION
values

The index values to use.

TYPE: IndexValuesLike

RETURNS DESCRIPTION
RecordingView

A new view containing the provided index values.

The original view will not be modified.

class RRDArchive

An archive loaded from an RRD.

RRD archives may include 1 or more recordings or blueprints.

def all_recordings()

All the recordings in the archive.

def num_recordings()

The number of recordings in the archive.

class Schema

The schema representing a set of available columns.

Can be returned by Recording.schema() or RecordingView.schema().

def __iter__()

Iterate over all the column descriptors in the schema.

def column_for(entity_path, component)

Look up the column descriptor for a specific entity path and component.

PARAMETER DESCRIPTION
entity_path

The entity path to look up.

TYPE: str

component

The component to look up.

TYPE: ComponentLike

RETURNS DESCRIPTION
Optional[ComponentColumnDescriptor]

The column descriptor, if it exists.

def component_columns()

Return a list of all the component columns in the schema.

def index_columns()

Return a list of all the index columns in the schema.

def load_archive(path_to_rrd)

Load a rerun archive from an RRD file.

PARAMETER DESCRIPTION
path_to_rrd

The path to the file to load.

TYPE: str | PathLike

RETURNS DESCRIPTION
RRDArchive

The loaded archive.

def load_recording(path_to_rrd)

Load a single recording from an RRD file.

Will raise a ValueError if the file does not contain exactly one recording.

PARAMETER DESCRIPTION
path_to_rrd

The path to the file to load.

TYPE: str | PathLike

RETURNS DESCRIPTION
Recording

The loaded recording.