Take last

See also

  • Official ReactiveX documentation: TakeLast
Observable.take_last(count)

Returns a specified number of contiguous elements from the end of an observable sequence.

Example: res = source.take_last(5)

Description: This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.

Keyword arguments: :param int count: Number of elements to take from the end of the source

sequence.
Returns:An observable sequence containing the specified number of elements from the end of the source sequence.
Return type:Observable
Observable.take_last_buffer(count)

Returns an array with the specified number of contiguous elements from the end of an observable sequence.

Example: res = source.take_last(5)

Description: This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.

Keyword arguments: :param int count: Number of elements to take from the end of the source

sequence.
Returns:An observable sequence containing a single list with the specified

number of elements from the end of the source sequence. :rtype: Observable

../../_images/takeLastBuffer.png