InputColumn
The InputColumn
class represents a column of data that can be used as input when creating or updating tables in Deephaven. It is a flexible way to define columns with specific names and data types, supporting a wide range of data sources and types.
Note
InputColumn
is often used with new_table
and related table creation methods to supply data for new columns.
Syntax
InputColumn(name: str, data: Sequence[Any], dtype: Optional[type] = None) -> InputColumn
Parameters
Parameter | Type | Description |
---|---|---|
name | str | The name of the new column. |
data | Sequence[Any] | The column values. This can be any sequence of compatible data, such as a list, tuple, NumPy ndarray, pandas Series, etc. |
dtype | Optional[type] | (Optional) The data type for the column. If not specified, the type is inferred from the data. |
Returns
An InputColumn
object that can be used as an argument to table creation or update methods.
Examples
from deephaven.column import InputColumn
from deephaven.table_factory import new_table
from deephaven.dtypes import int32
# Create an InputColumn with integer data
ic = InputColumn(name="numbers", data_type=int32, input_data=[1, 2, 3, 4, 5])
# Use InputColumn to create a new table
result = new_table([ic])
from deephaven.column import InputColumn
from deephaven.table_factory import new_table
from deephaven.dtypes import double
# Create an InputColumn with integer data
ic = InputColumn(name="floats", data_type=double, input_data=[1.1, 2.2, 3.3])
# Use InputColumn to create a new table
result = new_table([ic])