pydeephaven.combo_agg

class AggBase[source]

Bases: abc.ABC

class ComboAggregation[source]

Bases: object

A ComboAggregation object defines a list of aggregations operations that can be evaluated in one single call to the server, as compared to multiple round trips if individual aggregate method is called on a table.

Note, a ComboAggregation object is not bound to any table, thus can be reused on tables with the same schema.

abs_sum(cols)[source]

Add an Absolute-sum aggregation to the ComboAggregation object.

Parameters

cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

avg(cols)[source]

Add an Average aggregation to the ComboAggregation object.

Parameters

cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

count(col)[source]

Add a Count aggregation to the ComboAggregation object.

Parameters

col (str) – the column to hold the counts of each distinct group

Returns

self

first(cols)[source]

Add a First aggregation to the ComboAggregation object.

Parameters

cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

group(cols)[source]

Add a group aggregation to the ComboAggregation object.

Parameters

cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

last(cols)[source]

Add a Last aggregation to the ComboAggregation object.

Parameters

cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

max(cols)[source]

Add a Max aggregation to the ComboAggregation object.

Parameters

cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

median(cols)[source]

Add a Median aggregation to the ComboAggregation object.

Parameters

cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

min(cols)[source]

Add a Min aggregation to the ComboAggregation object.

Parameters

cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

pct(percentile, cols)[source]

Add a Percentile aggregation to the ComboAggregation object.

Parameters
  • percentile (float) – the percentile used for calculation

  • cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

std(cols)[source]

Add a Std aggregation to the ComboAggregation object.

Parameters

cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

sum(cols)[source]

Add a Sum aggregation to the ComboAggregation object.

Parameters

cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

var(cols)[source]

Add a Var aggregation to the ComboAggregation object.

Parameters

cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

weighted_avg(wcol, cols)[source]

Add a Weighted-avg aggregation to the ComboAggregation object.

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

  • cols (List[str]) – the columns to aggregate on, can be renaming expressions, i.e. “new_col = col”

Returns

self

class CommonAgg(agg_type, match_pairs)[source]

Bases: pydeephaven.combo_agg.AggBase

class CountAgg(count_column)[source]

Bases: pydeephaven.combo_agg.AggBase

class PctAgg(percentile, match_pairs)[source]

Bases: pydeephaven.combo_agg.CommonAgg

class WeightedAvgAgg(weight_column, match_pairs)[source]

Bases: pydeephaven.combo_agg.CommonAgg