deephaven.numpy

This module supports the conversion between Deephaven tables and numpy arrays.

column_to_numpy_array(col_def, j_array)[source]

Produces a numpy array from the given Java array and the Table column definition.

Return type

ndarray

freeze_table(table)[source]

Returns a static snapshot of the source ticking table.

Parameters

table (Table) – the source table

Return type

Table

Returns

a new table

to_numpy(table, cols=None)[source]

Produces a numpy array from a table.

Note that the entire table is going to be cloned into memory, so the total number of entries in the table should be considered before blindly doing this. For large tables, consider using the Deephaven query language to select a subset of the table before using this method.

Parameters
  • table (Table) – the source table

  • cols (List[str]) – the source column names, default is None which means include all columns

Return type

ndarray

Returns

a numpy ndarray

Raises

DHError

to_table(np_array, cols)[source]

Creates a new table from a numpy array.

Parameters
  • np_array (np.ndarray) – the numpy array

  • cols (List[str]) – the table column names that will be assigned to each column in the numpy array

Return type

Table

Returns

a Deephaven table

Raises

DHError