Filtering Iterables With Python

Python’s filter() is a built-in function that allows you to process an iterable and extract those items that satisfy a given condition. This process is commonly known as a filtering operation. With filter(), you can apply a filtering function to an iterable and produce a new iterable with the items that satisfy the condition at hand. In Python, filter() is one of the tools that you can use for functional programming.

In this video course, you’ll learn how to:

  • Use Python’s filter() in your code
  • Extract needed values from your iterables
  • Combine filter() with other functional tools
  • Replace filter() with more Pythonic tools

With this knowledge, you’ll be able to use filter() effectively in your code. Alternatively, you have the choice of using list comprehensions or generator expressions to write more Pythonic and readable code.

To better understand filter(), it would be helpful for you to have some previous knowledge on iterables, for loops, functions, and lambda functions. You can also refresh your memory of lambda functions through a video course.


[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Related Articles

Open Source Databases

We had a very fun and engaging chat with Matt Yonkovit who is the Chief Experience Officer at Percona, a service provider for open source databases like MySQL, PostgreSQL, MariaDB, and RocksDB. Matt has worked as a database architect for 10 years before transitioning into consulting roles at both MySQL and Sun Microsystems. In total, he’s been working with databases and open source for nearly 25 years.

Open Source Readiness

James has a lot of experience from both the developer side and the community side of open source. We dive deep into open source communities and enterprise involvement within those communities. Some of the topics we cover include: What is an open source readiness program and why should enterprises have one in place? Open source program offices and and the benefits of contributing to open source communities