Min

Pydoc Pydoc




Gets the element with the minimum value within each aggregation.

Examples

In the following example, we create a pipeline with a PCollection. Then, we get the element with the minimum value in different ways.

Example 1: Minimum element in a PCollection

We use Combine.Globally() to get the minimum element from the entire PCollection.

Example 2: Minimum elements for each key

We use Combine.PerKey() to get the minimum element for each unique key in a PCollection of key-values.

Pydoc Pydoc