Boolean Indexing (NumPy)

Boolean indexing filters a NumPy array by passing it a boolean mask of the same shape, keeping only the elements where the mask is True. It is the standard…