Filtering data
Filtering is used to restrict the data you are processing
Filter by an attribute
Here is an example filter by a string attribute and equality operator
for flight in flights
filter flight.TailNum == 'N592ML'
return flightHere is an example filter by a integer attribute and
>
operatorfor flight in flights
filter flight.Distance > 600
return flightYou can also create compound/composite conditions
for flight in flights
filter flight.Distance > 600
filter flight.TailNum == 'N592ML'
return flightThe query above is exactly the same as a composite AND
for flight in flights
filter flight.Distance > 600 and flight.TailNum == 'N592ML'
return flightThe query above is NOT the same as the as query with OR
for flight in flights
filter flight.Distance > 600 or flight.TailNum == 'N592ML'
return flight
Help us improve
Anything unclear or buggy in this tutorial? Provide Feedback