skip

A Python module used for interacting with collections of objects using LINQ syntax


skip

skip(n)

The skip method skips the first n elements in a collection and returns the remaining elements. This method is not an executing function.

Parameters:

n: The number of elements to skip before returning the remaining elements.

Returns:

An Enumerable object whose elements are the ones remaining after skipping the first n elements.

Example


from py_linq import Enumerable

students = Enumerable([{ 'name': 'Joe Smith', 'mark': 80}, { 'name': 'Joanne Smith', 'mark': 90}])
joanne = students.skip(1).to_list() # results in { 'name': 'Joanne Smith', 'mark': 90}