Max

See also

  • Official ReactiveX documentation: Max
Observable.max(comparer=None)

Returns the maximum value in an observable sequence according to the specified comparer.

Example res = source.max() res = source.max(lambda x, y: x.value - y.value)

Keyword arguments: comparer – {Function} [Optional] Comparer used to compare elements.

Returns {Observable} An observable sequence containing a single element with the maximum element in the source sequence.

../../_images/max.png
Observable.max_by(key_selector, comparer=None)

Returns the elements in an observable sequence with the maximum key value according to the specified comparer.

Example res = source.max_by(lambda x: x.value) res = source.max_by(lambda x: x.value, lambda x, y: x - y)

Keyword arguments: key_selector – {Function} Key selector function. comparer – {Function} [Optional] Comparer used to compare key values.

Returns an observable {Observable} sequence containing a list of zero or more elements that have a maximum key value.

../../_images/maxBy.png