deephaven.column

This module implements the Column class and functions that work with Columns.

class Column(name, data_type, component_type=None, column_type=ColumnType.NORMAL)[source]

Bases: ColumnDefinition

A Column object represents a column definition in a Deephaven Table. Deprecated for removal next release, prefer col_def.

Deprecated for removal next release, prefer col_def.

property column_type

The column type.

property component_type

The column component type.

property data_type

The column data type.

j_object_type

alias of ColumnDefinition

property name

The column name.

class ColumnDefinition(j_column_definition)[source]

Bases: JObjectWrapper

A Deephaven column definition.

property column_type

The column type.

property component_type

The column component type.

property data_type

The column data type.

j_object_type

alias of ColumnDefinition

property name

The column name.

class ColumnType(value)[source]

Bases: Enum

An enumeration.

NORMAL = io.deephaven.engine.table.ColumnDefinition$ColumnType(objectRef=0x5565f2fbd6f2)

A regular column.

PARTITIONING = io.deephaven.engine.table.ColumnDefinition$ColumnType(objectRef=0x5565f2fbd6fa)

A partitioning column.

class InputColumn(name=None, data_type=None, component_type=None, column_type=ColumnType.NORMAL, input_data=None)[source]

Bases: object

An InputColumn represents a user defined column with some input data.

Creates an InputColumn. :type name: Optional[str] :param name: the column name :type name: str :type data_type: Optional[DType] :param data_type: the column data type :type data_type: DType :type component_type: Optional[DType] :param component_type: the column component type, None by default :type component_type: Optional[DType] :type column_type: ColumnType :param column_type: the column type, NORMAL by default :type column_type: ColumnType :type input_data: Optional[Any] :param input_data: Any: the input data, by default is None

Returns:

a new InputColumn

Raises:

DHError

bool_col(name, data)[source]

Creates an input column containing Boolean data.

Parameters:
  • name (str) – the column name

  • data (Any) – a sequence of compatible data, e.g. list, tuple, numpy array, Pandas series, etc.

Return type:

InputColumn

Returns:

a new input column

byte_col(name, data)[source]

Creates an input column containing primitive byte data.

Parameters:
  • name (str) – the column name

  • data (Any) – a sequence of compatible data, e.g. list, tuple, numpy array, Pandas series, etc.

Return type:

InputColumn

Returns:

a new input column

char_col(name, data)[source]

Creates an input column containing primitive char data.

Parameters:
  • name (str) – the column name

  • data (Any) – a sequence of compatible data, e.g. list, tuple, numpy array, Pandas series, etc.

Return type:

InputColumn

Returns:

a new input column

col_def(name, data_type, component_type=None, column_type=ColumnType.NORMAL)[source]

Creates a ColumnDefinition.

Parameters:
  • name (str) – the column name

  • data_type (DType) – the column data type

  • component_type (Optional[DType]) – the column component type, None by default

  • column_type (ColumnType) – the column type, ColumnType.NORMAL by default

Return type:

ColumnDefinition

Returns:

a new ColumnDefinition

Raises:

DHError

datetime_col(name, data)[source]

Creates an input column containing Deephaven Datetime instances.

Parameters:
  • name (str) – the column name

  • data (Any) – a sequence of Datetime instances or values that can be converted to Datetime instances (e.g. Instant, int nanoseconds since the Epoch, str, datetime.datetime, numpy.datetime64, pandas.Timestamp).

Return type:

InputColumn

Returns:

a new input column

double_col(name, data)[source]

Creates an input column containing primitive double data.

Parameters:
  • name (str) – the column name

  • data (Any) – a sequence of compatible data, e.g. list, tuple, numpy array, Pandas series, etc.

Return type:

InputColumn

Returns:

a new input column

float_col(name, data)[source]

Creates an input column containing primitive float data.

Parameters:
  • name (str) – the column name

  • data (Any) – a sequence of compatible data, e.g. list, tuple, numpy array, Pandas series, etc.

Return type:

InputColumn

Returns:

a new input column

int_col(name, data)[source]

Creates an input column containing primitive int data.

Parameters:
  • name (str) – the column name

  • data (Any) – a sequence of compatible data, e.g. list, tuple, numpy array, Pandas series, etc.

Return type:

InputColumn

Returns:

a new input column

jobj_col(name, data)[source]

Creates an input column containing Java objects.

Parameters:
  • name (str) – the column name

  • data (Any) – a sequence of Java objects

Return type:

InputColumn

Returns:

a new input column

long_col(name, data)[source]

Creates an input column containing primitive long data.

Parameters:
  • name (str) – the column name

  • data (Any) – a python sequence of compatible data, could be numpy array or Pandas series

Return type:

InputColumn

Returns:

a new input column

pyobj_col(name, data)[source]

Creates an input column containing complex, non-primitive-like Python objects.

Parameters:
  • name (str) – the column name

  • data (Any) – a sequence of Python objects

Return type:

InputColumn

Returns:

a new input column

short_col(name, data)[source]

Creates an input column containing primitive short data.

Parameters:
  • name (str) – the column name

  • data (Any) – a sequence of compatible data, e.g. list, tuple, numpy array, Pandas series, etc.

Return type:

InputColumn

Returns:

a new input column

string_col(name, data)[source]

Creates an input column containing string data.

Parameters:
  • name (str) – the column name

  • data (Any) – a sequence of compatible data, e.g. list, tuple, numpy array, Pandas series, etc.

Return type:

InputColumn

Returns:

a new input column