Table Of Contents

Search

Enter search terms or a module, class or function name.

pandas.Index.any

Index.any(*args, **kwargs)[source]

Return whether any element is True.

Parameters:

*args

These parameters will be passed to numpy.any.

**kwargs

These parameters will be passed to numpy.any.

Returns:

any : bool or array_like (if axis is specified)

A single element array_like may be converted to bool.

See also

pandas.Index.all
Return whether all elements are True.
pandas.Series.all
Return whether all elements are True.

Notes

Not a Number (NaN), positive infinity and negative infinity evaluate to True because these are not equal to zero.

Examples

>>> index = pd.Index([0, 1, 2])
>>> index.any()
True
>>> index = pd.Index([0, 0, 0])
>>> index.any()
False
Scroll To Top