sknano.core.math.Vectors.filter

Vectors.filter(condition, invert=False)[source][source]

Filter Vectors by condition.

Parameters:

condition : array_like, bool

Boolean index array having same shape as the initial dimensions of the list of Vectors being indexed.

invert : bool, optional

If True, the boolean array condition is inverted element-wise.

Returns:

filtered_vectors : Vectors

If invert is False, return the elements where condition is True.

If invert is True, return the elements where condition (i.e., numpy.invert(condition)) is True.