Skip to main content
Version: Python

new_table

The new_table method creates an in-memory table from a list of columns. Each column must have an equal number of elements.

Syntax

new_table(cols: list[InputColumn]) -> Table

Parameters

ParameterTypeDescription
colsInputColumn

Columns are created using the following methods:

Returns

An in-memory table.

Examples

The following example creates a table with one column of three integer values.

from deephaven import new_table
from deephaven.column import int_col

result = new_table([int_col("IntegerColumn", [1, 2, 3])])

The following example creates a table with a double and a string column.

from deephaven import new_table
from deephaven.column import string_col, double_col

result = new_table(
[
double_col("Doubles", [3.1, 5.45, -1.0]),
string_col("Strings", ["Creating", "New", "Tables"]),
]
)