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

Function argmin_rows

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

Source from the content-addressed store, hash-verified

18
19
20def argmin_rows(
21 table: pw.Table, *on: pw.ColumnReference, what: pw.ColumnReference
22) -> pw.Table:
23 filter = (
24 table.groupby(*on)
25 .reduce(argmin_id=pw.reducers.argmin(what))
26 .with_id(pw.this.argmin_id)
27 .promise_universe_is_subset_of(table)
28 )
29 return table.restrict(filter)

Callers 2

test_argmin_rows_01Function · 0.90
test_argmin_rows_02Function · 0.90

Calls 5

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

Tested by 2

test_argmin_rows_01Function · 0.72
test_argmin_rows_02Function · 0.72