Skip to main content

Filtering NumPy Array

Body

In this tutorial you will learn:

  • What is Array Filtering?
  • Boolean Array based filtering

Array Filtering

Separating specific elements based on a specific condition and making another array from those elements is called filtering. Filtering can be carried out either by iterating complete array and checking each element against a specific condition or it can be carried out using by applying a Boolean array on the given array which we want to filter out.

Boolean Array Based Filtering

In NumPy, Boolean Array filtration is carried out using a Boolean index list, when the index is

Add new comment

Screenshot