pandas / 1.4.0 / reference / api / pandas.index.any.html /

pandas.Index.any

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

Return whether any element is Truthy.

Parameters
*args

Required for compatibility with numpy.

**kwargs

Required for compatibility with numpy.

Returns
any :bool or array-like (if axis is specified)

A single element array-like may be converted to bool.

See also

Index.all

Return whether all elements are True.

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

© 2008–2022, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.4.0/reference/api/pandas.Index.any.html