deephaven.table_factory

This module provides various ways to make a Deephaven table.

class DynamicTableWriter(col_defs)[source]

Bases: deephaven._wrapper.JObjectWrapper

The DynamicTableWriter creates a new in-memory table and supports writing data to it.

This class implements the context manager protocol and thus can be used in with statements.

close()[source]

Closes the writer.

Raises

DHError

Return type

None

j_object_type

alias of io.deephaven.engine.table.impl.util.DynamicTableWriter

write_row(*values)[source]

Writes a row to the newly created table.

The type of a value must be convertible (safely or unsafely, e.g. lose precision, overflow, etc.) to the type of the corresponding column.

Parameters

*values (Any) – the values of the new row, the data types of these values must match the column definitions of the table

Raises

DHError

Return type

None

class InputTable(col_defs=None, init_table=None, key_cols=None)[source]

Bases: deephaven.table.Table

InputTable is a subclass of Table that allows the users to dynamically add/delete/modify data in it. There are two types of InputTable - append-only and keyed.

The append-only input table is not keyed, all rows are added to the end of the table, and deletions and edits are not permitted.

The keyed input tablet has keys for each row and supports addition/deletion/modification of rows by the keys.

abs_sum_by(by=None)

The abs_sum_by method creates a new table containing the absolute sum for each group.

Parameters

by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

add(table)[source]

Writes rows from the provided table to this input table. If this is a keyed input table, added rows with keys that match existing rows will replace those rows.

Parameters

table (Table) – the table that provides the rows to write

Raises

DHError

Return type

None

agg_all_by(agg, by=None)

The agg_all_by method creates a new table containing grouping columns and grouped data. The resulting grouped data is defined by the aggregation specified.

Note, because agg_all_by applies the aggregation to all the columns of the table, it will ignore any column names specified for the aggregation.

Parameters
  • agg (Aggregation) – the aggregation

  • by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

agg_by(aggs, by=None, preserve_empty=False, initial_groups=None)

The agg_by method creates a new table containing grouping columns and grouped data. The resulting grouped data is defined by the aggregations specified.

Parameters
  • aggs (Union[Aggregation, Sequence[Aggregation]]) – the aggregation(s)

  • by (Union[str, Sequence[str]]) – the group-by column name(s), if not provided, all rows from this table are grouped into a single group of rows before the aggregations are applied to the result, default is None.

  • preserve_empty (bool) – whether to keep result rows for groups that are initially empty or become empty as a result of updates. Each aggregation operator defines its own value for empty groups. Default is False.

  • initial_groups (Table) – a table whose distinct combinations of values for the group-by column(s) should be used to create an initial set of aggregation groups. All other columns are ignored. This is useful in combination with preserve_empty=True to ensure that particular groups appear in the result table, or with preserve_empty=False to control the encounter order for a collection of groups and thus their relative order in the result. Changes to this table are not expected or handled; if this table is a refreshing table, only its contents at instantiation time will be used. Default is None, the result will be the same as if a table is provided but no rows were supplied. When it is provided, the ‘by’ argument must be provided to explicitly specify the grouping columns.

Return type

Table

Returns

a new table

Raises

DHError

aj(table, on, joins=None, match_rule=<AsOfMatchRule.LESS_THAN_EQUAL: io.deephaven.engine.table.Table$AsOfMatchRule(objectRef=0x4446758)>)

The aj (as-of join) method creates a new table containing all of the rows and columns of the left table, plus additional columns containing data from the right table. For columns appended to the left table (joins), row values equal the row values from the right table where the keys from the left table most closely match the keys from the right table without going over. If there is no matching key in the right table, appended row values are NULL.

Parameters
  • table (Table) – the right-table of the join

  • on (Union[str, Sequence[str]]) – the column(s) to match, can be a common name or an equal expression, i.e. “col_a = col_b” for different column names

  • joins (Union[str, Sequence[str]], optional) – the column(s) to be added from the right table to the result table, can be renaming expressions, i.e. “new_col = col”; default is None

  • match_rule (AsOfMatchRule) – the inexact matching rule on the last column to match specified in ‘on’, default is AsOfMatchRule.LESS_THAN_EQUAL. The other valid value is AsOfMatchRule.LESS_THAN.

Return type

Table

Returns

a new table

Raises

DHError

avg_by(by=None)

The avg_by method creates a new table containing the average for each group.

Parameters

by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

coalesce()

Returns a coalesced child table.

Return type

Table

property columns: List[deephaven.column.Column]

The column definitions of the table.

Return type

List[Column]

count_by(col, by=None)

The count_by method creates a new table containing the number of rows for each group.

Parameters
  • col (str) – the name of the column to store the counts

  • by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

delete(table)[source]

Deletes the keys contained in the provided table from this keyed input table. If this method is called on an append-only input table, a PermissionError will be raised.

Parameters

table (Table) – the table with the keys to delete

Raises

DHError

Return type

None

drop_columns(cols)

The drop_columns method creates a new table with the same size as this table but omits any of specified columns.

Parameters

cols (Union[str, Sequence[str]) – the column name(s)

Return type

Table

Returns

a new table

Raises

DHError

exact_join(table, on, joins=None)

The exact_join method creates a new table containing all of the rows and columns of this table plus additional columns containing data from the right table. For columns appended to the left table (joins), row values equal the row values from the right table where the key values in the left and right tables are equal.

Parameters
  • table (Table) – the right-table of the join

  • on (Union[str, Sequence[str]]) – the column(s) to match, can be a common name or an equal expression, i.e. “col_a = col_b” for different column names

  • joins (Union[str, Sequence[str]], optional) – the column(s) to be added from the right table to the result table, can be renaming expressions, i.e. “new_col = col”; default is None

Return type

Table

Returns

a new table

Raises

DHError

first_by(by=None)

The first_by method creates a new table containing the first row for each group.

Parameters

by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

format_column_where(col, cond, formula)

Applies color formatting to a column of the table conditionally.

Parameters
  • col (str) – the column name

  • cond (str) – the condition expression

  • formula (str) – the formatting string in the form of assignment expression “column=color expression” where color_expression can be a color name or a Java ternary expression that results in a color.

Return type

Table

Returns

a new table

Raises

DHError

format_columns(formulas)

Applies color formatting to the columns of the table.

Parameters

formulas (Union[str, List[str]]) – formatting string(s) in the form of “column=color_expression” where color_expression can be a color name or a Java ternary expression that results in a color.

Return type

Table

Returns

a new table

Raises

DHError

format_row_where(cond, formula)

Applies color formatting to rows of the table conditionally.

Parameters
  • cond (str) – the condition expression

  • formula (str) – the formatting string in the form of assignment expression “column=color expression” where color_expression can be a color name or a Java ternary expression that results in a color.

Return type

Table

Returns

a new table

Raises

DHError

group_by(by=None)

The group_by method creates a new table containing grouping columns and grouped data, column content is grouped into arrays.

Parameters

by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

head(num_rows)

The head method creates a new table with a specific number of rows from the beginning of the table.

Parameters

num_rows (int) – the number of rows at the head of table

Return type

Table

Returns

a new table

Raises

DHError

head_by(num_rows, by=None)

The head_by method creates a new table containing the first number of rows for each group.

Parameters
  • num_rows (int) – the number of rows at the beginning of each group

  • by (Union[str, Sequence[str]]) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

head_pct(pct)

The head_pct method creates a new table with a specific percentage of rows from the beginning of the table.

Parameters

pct (float) – the percentage of rows to return as a value from 0 (0%) to 1 (100%).

Return type

Table

Returns

a new table

Raises

DHError

property is_refreshing: bool

Whether this table is refreshing.

Return type

bool

j_object_type

alias of io.deephaven.engine.table.Table

join(table, on=None, joins=None)

The join method creates a new table containing rows that have matching values in both tables. Rows that do not have matching criteria will not be included in the result. If there are multiple matches between a row from the left table and rows from the right table, all matching combinations will be included. If no columns to match (on) are specified, every combination of left and right table rows is included.

Parameters
  • table (Table) – the right-table of the join

  • on (Union[str, Sequence[str]]) – the column(s) to match, can be a common name or an equal expression, i.e. “col_a = col_b” for different column names; default is None

  • joins (Union[str, Sequence[str]], optional) – the column(s) to be added from the right table to the result table, can be renaming expressions, i.e. “new_col = col”; default is None

Return type

Table

Returns

a new table

Raises

DHError

last_by(by=None)

The last_by method creates a new table containing the last row for each group.

Parameters

by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

layout_hints(front=None, back=None, freeze=None, hide=None, column_groups=None)

Sets layout hints on the Table

Parameters
  • front (Union[str, List[str]]) – the columns to show at the front.

  • back (Union[str, List[str]]) – the columns to show at the back.

  • freeze (Union[str, List[str]]) – the columns to freeze to the front. These will not be affected by horizontal scrolling.

  • hide (Union[str, List[str]]) – the columns to hide.

  • column_groups (List[Dict]) –

    A list of dicts specifying which columns should be grouped in the UI The dicts can specify the following:

    name (str): The group name children (List[str]): The color (Optional[str]): The hex color string or Deephaven color name

Return type

Table

Returns

a new table with the layout hints set

Raises

DHError

lazy_update(formulas)

The lazy_update method creates a new table containing a new, cached, formula column for each formula.

Parameters

formulas (Union[str, Sequence[str]]) – the column formula(s)

Return type

Table

Returns

a new table

Raises

DHError

max_by(by=None)

The max_by method creates a new table containing the maximum value for each group.

Parameters

by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

median_by(by=None)

The median_by method creates a new table containing the median for each group.

Parameters

by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

property meta_table: deephaven.table.Table

The column definitions of the table in a Table form.

Return type

Table

min_by(by=None)

The min_by method creates a new table containing the minimum value for each group.

Parameters

by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

move_columns(idx, cols)

The move_columns method creates a new table with specified columns moved to a specific column index value.

Parameters
  • idx (int) – the column index where the specified columns will be moved in the new table.

  • cols (Union[str, Sequence[str]]) – the column name(s)

Return type

Table

Returns

a new table

Raises

DHError

move_columns_down(cols)

The move_columns_down method creates a new table with specified columns appearing last in order, to the far right.

Parameters

cols (Union[str, Sequence[str]]) – the column name(s)

Return type

Table

Returns

a new table

Raises

DHError

move_columns_up(cols)

The move_columns_up method creates a new table with specified columns appearing first in order, to the far left.

Parameters

cols (Union[str, Sequence[str]]) – the column name(s)

Return type

Table

Returns

a new table

Raises

DHError

natural_join(table, on, joins=None)

The natural_join method creates a new table containing all of the rows and columns of this table, plus additional columns containing data from the right table. For columns appended to the left table (joins), row values equal the row values from the right table where the key values in the left and right tables are equal. If there is no matching key in the right table, appended row values are NULL.

Parameters
  • table (Table) – the right-table of the join

  • on (Union[str, Sequence[str]]) – the column(s) to match, can be a common name or an equal expression, i.e. “col_a = col_b” for different column names

  • joins (Union[str, Sequence[str]], optional) – the column(s) to be added from the right table to the result table, can be renaming expressions, i.e. “new_col = col”; default is None

Return type

Table

Returns

a new table

Raises

DHError

partition_by(by, drop_keys=False)

Creates a PartitionedTable from this table, partitioned according to the specified key columns.

Parameters
  • by (Union[str, Sequence[str]]) – the column(s) by which to group data

  • drop_keys (bool) – whether to drop key columns in the constituent tables, default is False

Return type

PartitionedTable

Returns

A PartitionedTable containing a sub-table for each group

Raises

DHError

partitioned_agg_by(aggs, by=None, preserve_empty=False, initial_groups=None)

The partitioned_agg_by method is a convenience method that performs an agg_by operation on this table and wraps the result in a PartitionedTable. If the argument ‘aggs’ does not include a partition aggregation created by calling agg.partition(), one will be added automatically with the default constituent column name __CONSTITUENT__.

Parameters
  • aggs (Union[Aggregation, Sequence[Aggregation]]) – the aggregation(s)

  • by (Union[str, Sequence[str]]) – the group-by column name(s), default is None

  • preserve_empty (bool) – whether to keep result rows for groups that are initially empty or become empty as a result of updates. Each aggregation operator defines its own value for empty groups. Default is False.

  • initial_groups (Table) – a table whose distinct combinations of values for the group-by column(s) should be used to create an initial set of aggregation groups. All other columns are ignored. This is useful in combination with preserve_empty=True to ensure that particular groups appear in the result table, or with preserve_empty=False to control the encounter order for a collection of groups and thus their relative order in the result. Changes to this table are not expected or handled; if this table is a refreshing table, only its contents at instantiation time will be used. Default is None, the result will be the same as if a table is provided but no rows were supplied. When it is provided, the ‘by’ argument must be provided to explicitly specify the grouping columns.

Return type

PartitionedTable

Returns

a PartitionedTable

Raises

DHError

raj(table, on, joins=None, match_rule=<AsOfMatchRule.GREATER_THAN_EQUAL: io.deephaven.engine.table.Table$AsOfMatchRule(objectRef=0x4446768)>)

The reverse-as-of join method creates a new table containing all of the rows and columns of the left table, plus additional columns containing data from the right table. For columns appended to the left table (joins), row values equal the row values from the right table where the keys from the left table most closely match the keys from the right table without going under. If there is no matching key in the right table, appended row values are NULL.

Parameters
  • table (Table) – the right-table of the join

  • on (Union[str, Sequence[str]]) – the column(s) to match, can be a common name or an equal expression, i.e. “col_a = col_b” for different column names

  • joins (Union[str, Sequence[str]], optional) – the column(s) to be added from the right table to the result table, can be renaming expressions, i.e. “new_col = col”; default is None

  • match_rule (AsOfMatchRule) – the inexact matching rule on the last column to match specified in ‘on’, default is AsOfMatchRule.GREATER_THAN_EQUAL. The other valid value is AsOfMatchRule.GREATER_THAN.

Return type

Table

Returns

a new table

Raises

DHError

rename_columns(cols)

The rename_columns method creates a new table with the specified columns renamed.

Parameters

cols (Union[str, Sequence[str]]) – the column rename expr(s) as “X = Y”

Return type

Table

Returns

a new table

Raises

DHError

restrict_sort_to(cols)

The restrict_sort_to method only allows sorting on specified table columns. This can be useful to prevent users from accidentally performing expensive sort operations as they interact with tables in the UI.

Parameters

cols (Union[str, Sequence[str]]) – the column name(s)

Raises

DHError

reverse()

The reverse method creates a new table with all of the rows from this table in reverse order.

Return type

Table

Returns

a new table

Raises

DHError

select(formulas=None)

The select method creates a new in-memory table that includes one column for each formula. If no formula is specified, all columns will be included.

Parameters

formulas (Union[str, Sequence[str]], optional) – the column formula(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

select_distinct(formulas=None)

The select_distinct method creates a new table containing all of the unique values for a set of key columns. When the selectDistinct method is used on multiple columns, it looks for distinct sets of values in the selected columns.

Parameters

formulas (Union[str, Sequence[str]], optional) – the column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

property size: int

The current number of rows in the table.

Return type

int

slice(start, stop)

Extracts a subset of a table by row positions into a new Table.

If both the start and the stop are positive, then both are counted from the beginning of the table. The start is inclusive, and the stop is exclusive. slice(0, N) is equivalent to head(N)() The start must be less than or equal to the stop.

If the start is positive and the stop is negative, then the start is counted from the beginning of the table, inclusively. The stop is counted from the end of the table. For example, slice(1, -1) includes all rows but the first and last. If the stop is before the start, the result is an empty table.

If the start is negative, and the stop is zero, then the start is counted from the end of the table, and the end of the slice is the size of the table. slice(-N, 0) is equivalent to tail(N)().

If the start is negative and the stop is negative, they are both counted from the end of the table. For example, slice(-2, -1) returns the second to last row of the table.

Parameters
  • start (int) – the first row position to include in the result

  • stop (int) – the last row position to include in the result

Return type

Table

Returns

a new Table

Raises

DHError

snapshot(source_table, do_init=False, cols=None)

Produces an in-memory copy of a source table that refreshes when this table changes.

Note, this table is often a time table that adds new rows at a regular, user-defined interval.

Parameters
  • source_table (Table) – the table to be snapshot

  • do_init (bool) – whether to snapshot when this method is initially called, default is False

  • cols (Union[str, List[str]]) – names of the columns of this table to be included in the snapshot, default is None, meaning all the columns

Return type

Table

Returns

a new table

Raises

DHError

snapshot_history(source_table)

Produces an in-memory history of a source table that adds a new snapshot when this table (trigger table) changes.

The trigger table is often a time table that adds new rows at a regular, user-defined interval.

Columns from the trigger table appear in the result table. If the trigger and source tables have columns with the same name, an error will be raised. To avoid this problem, rename conflicting columns.

Because snapshot_history stores a copy of the source table for every trigger event, large source tables or rapidly changing trigger tables can result in large memory usage.

Parameters

source_table (Table) – the table to be snapshot

Return type

Table

Returns

a new table

Raises

DHError

sort(order_by, order=None)

The sort method creates a new table where the rows are ordered based on values in a specified set of columns.

Parameters
  • order_by (Union[str, Sequence[str]]) – the column(s) to be sorted on

  • order (Union[SortDirection, Sequence[SortDirection], optional) – the corresponding sort directions for each sort column, default is None, meaning ascending order for all the sort columns.

Return type

Table

Returns

a new table

Raises

DHError

sort_descending(order_by)

The sort_descending method creates a new table where rows in a table are sorted in a largest to smallest order based on the order_by column(s).

Parameters

order_by (Union[str, Sequence[str]], optional) – the column name(s)

Return type

Table

Returns

a new table

Raises

DHError

std_by(by=None)

The std_by method creates a new table containing the standard deviation for each group.

Parameters

by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

sum_by(by=None)

The sum_by method creates a new table containing the sum for each group.

Parameters

by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

tail(num_rows)

The tail method creates a new table with a specific number of rows from the end of the table.

Parameters

num_rows (int) – the number of rows at the end of table

Return type

Table

Returns

a new table

Raises

DHError

tail_by(num_rows, by=None)

The tail_by method creates a new table containing the last number of rows for each group.

Parameters
  • num_rows (int) – the number of rows at the end of each group

  • by (Union[str, Sequence[str]]) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

tail_pct(pct)

The tail_pct method creates a new table with a specific percentage of rows from the end of the table.

Parameters

pct (float) – the percentage of rows to return as a value from 0 (0%) to 1 (100%).

Return type

Table

Returns

a new table

Raises

DHError

to_string(num_rows=10, cols=None)

Returns the first few rows of a table as a pipe-delimited string.

Parameters
  • num_rows (int) – the number of rows at the beginning of the table

  • cols (Union[str, Sequence[str]]) – the column name(s), default is None

Return type

str

Returns

string

Raises

DHError

ungroup(cols=None)

The ungroup method creates a new table in which array columns from the source table are unwrapped into separate rows.

Parameters

cols (Union[str, Sequence[str]], optional) – the name(s) of the array column(s), if None, all array columns will be ungrouped, default is None

Return type

Table

Returns

a new table

Raises

DHError

update(formulas)

The update method creates a new table containing a new, in-memory column for each formula.

Parameters

formulas (Union[str, Sequence[str]]) – the column formula(s)

Return type

Table

Returns

A new table

Raises

DHError

update_by(ops, by=None)

Creates a table with additional columns calculated from window-based aggregations of columns in this table. The aggregations are defined by the provided operations, which support incremental aggregations over the corresponding rows in the this table. The aggregations will apply position or time-based windowing and compute the results over the entire table or each row group as identified by the provided key columns.

Parameters
  • ops (Union[UpdateByOperation, List[UpdateByOperation]]) – the update-by operation definition(s)

  • by (Union[str, List[str]]) – the key column name(s) to group the rows of the table

Return type

Table

Returns

a new Table

Raises

DHError

update_view(formulas)

The update_view method creates a new table containing a new, formula column for each formula.

Parameters

formulas (Union[str, Sequence[str]]) – the column formula(s)

Return type

Table

Returns

a new table

Raises

DHError

var_by(by=None)

The var_by method creates a new table containing the variance for each group.

Parameters

by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

view(formulas)

The view method creates a new formula table that includes one column for each formula.

Parameters

formulas (Union[str, Sequence[str]]) – the column formula(s)

Return type

Table

Returns

a new table

Raises

DHError

weighted_avg_by(wcol, by=None)

The weighted_avg_by method creates a new table containing the weighted average for each group.

Parameters
  • wcol (str) – the name of the weight column

  • by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

weighted_sum_by(wcol, by=None)

The weighted_sum_by method creates a new table containing the weighted sum for each group.

Parameters
  • wcol (str) – the name of the weight column

  • by (Union[str, Sequence[str]], optional) – the group-by column name(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

where(filters=None)

The where method creates a new table with only the rows meeting the filter criteria in the column(s) of the table.

Parameters

filters (Union[str, Filter, Sequence[str], Sequence[Filter]], optional) – the filter condition expression(s) or Filter object(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

where_in(filter_table, cols)

The where_in method creates a new table containing rows from the source table, where the rows match values in the filter table. The filter is updated whenever either table changes.

Parameters
  • filter_table (Table) – the table containing the set of values to filter on

  • cols (Union[str, Sequence[str]]) – the column name(s)

Return type

Table

Returns

a new table

Raises

DHError

where_not_in(filter_table, cols)

The where_not_in method creates a new table containing rows from the source table, where the rows do not match values in the filter table.

Parameters
  • filter_table (Table) – the table containing the set of values to filter on

  • cols (Union[str, Sequence[str]]) – the column name(s)

Return type

Table

Returns

a new table

Raises

DHError

where_one_of(filters=None)

The where_one_of method creates a new table containing rows from the source table, where the rows match at least one filter.

Parameters

filters (Union[str, Sequence[str]], optional) – the filter condition expression(s), default is None

Return type

Table

Returns

a new table

Raises

DHError

empty_table(size)[source]

Creates a table with rows but no columns.

Parameters

size (int) – the number of rows

Return type

Table

Returns

a Table

Raises

DHError

merge(tables)[source]

Combines two or more tables into one aggregate table. This essentially appends the tables one on top of the other. Null tables are ignored.

Parameters

tables (List[Table]) – the source tables

Returns

a Table

Raises

DHError

merge_sorted(tables, order_by)[source]

Combines two or more tables into one sorted, aggregate table. This essentially stacks the tables one on top of the other and sorts the result. Null tables are ignored. mergeSorted is more efficient than using merge followed by sort.

Parameters
  • tables (List[Table]) – the source tables

  • order_by (str) – the name of the key column

Return type

Table

Returns

a Table

Raises

DHError

new_table(cols)[source]

Creates an in-memory table from a list of input columns. Each column must have an equal number of elements.

Parameters

cols (List[InputColumn]) – a list of InputColumn

Return type

Table

Returns

a Table

Raises

DHError

time_table(period, start_time=None)[source]

Creates a table that adds a new row on a regular interval.

Parameters
  • period (Union[str, int]) – time interval between new row additions, can be expressed as an integer in nanoseconds or a time interval string, e.g. “00:00:00.001”

  • start_time (str) – start time for adding new rows

Return type

Table

Returns

a Table

Raises

DHError