deephaven.learn.gather#

Utilities for gathering Deephaven table data into Python objects

class MemoryLayout(value)[source]#

Bases: Enum

Memory layouts for an array.

C = True#

Memory layout consistent with C arrays (row-major).

COLUMN_MAJOR = False#

Column-major memory layout.

FORTRAN = False#

Memory layout consistent with Fortran arrays (column-major).

ROW_MAJOR = True#

Row-major memory layout.

table_to_numpy_2d(row_set, col_set, order=MemoryLayout.ROW_MAJOR, np_type=<class 'numpy.int32'>)[source]#

Converts Deephaven table data to a 2d NumPy array of the appropriate size

Parameters:
  • row_set – a RowSequence describing the number of rows in the table

  • col_set – ColumnSources describing which columns to copy

  • order (MemoryLayout) – the desired memory layout of the output array

  • np_type (Type) – the desired NumPy data type of the output NumPy array

Return type:

ndarray

Returns

a np.ndarray

Raises:

DHError