Skip to main content
Version: Python

flatten

The flatten method returns a new copy of the source table with a flat row set - i.e., from 0 to number of rows - 1.

Syntax

table.flatten() -> Table

Parameters

This method takes no arguments.

Returns

A Table with a flat row set.

Example

The following example creates a non-flat time table, and then flattens it.

from deephaven.agg import first
from deephaven import time_table

tt = time_table("PT1S").update("X = ii").agg_by([first("X")], "Timestamp")

print(tt.is_flat)

result = tt.flatten()

print(result.is_flat)