to_table
The to_table method creates a new table from a NumPy NDArray.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| table | Table | The source table to convert to a |
| cols | List[str] | Defines the names of the columns in the resulting table. This parameter must have exactly as many column names as there are columns in the source NumPy NDArray. |
Returns
A Deephaven Table from the given NumPy NDArray and the column names.
Examples
In the following example, we create a NumPy NDArray and convert it to a Deephaven table using to_table.
In many cases, NumPy arrays are too large to manually enumerate all of the column names. In such cases, you may prefer to set column names programmatically, like so: