MCPcopy
hub / github.com/pathwaycom/pathway / argmax_rows

Function argmax_rows

python/pathway/stdlib/utils/filtering.py:8–17  ·  view source on GitHub ↗
(
    table: pw.Table, *on: pw.ColumnReference, what: pw.ColumnExpression
)

Source from the content-addressed store, hash-verified

6
7
8def argmax_rows(
9 table: pw.Table, *on: pw.ColumnReference, what: pw.ColumnExpression
10) -> pw.Table:
11 filter = (
12 table.groupby(*on)
13 .reduce(argmax_id=pw.reducers.argmax(what))
14 .with_id(pw.this.argmax_id)
15 .promise_universe_is_subset_of(table)
16 )
17 return table.restrict(filter)
18
19
20def argmin_rows(

Callers 4

_propose_clustersFunction · 0.90
_one_stepFunction · 0.90
test_argmax_rows_01Function · 0.90
test_argmax_rows_02Function · 0.90

Calls 5

with_idMethod · 0.80
restrictMethod · 0.80
reduceMethod · 0.45
groupbyMethod · 0.45

Tested by 2

test_argmax_rows_01Function · 0.72
test_argmax_rows_02Function · 0.72