bigframes.pandas.DataFrame.any#

DataFrame.any(*, axis: str | int = 0, bool_only: bool = False) Series[source]#

Return whether any element is True, potentially over an axis.

Returns False unless there is at least one element within a series or along a Dataframe axis that is True or equivalent (e.g. non-zero or non-empty).

Examples:

>>> df = bpd.DataFrame({"A": [True, True], "B": [False, False]})
>>> df
        A        B
0    True    False
1    True    False

[2 rows x 2 columns]

Checking if each column contains at least one True element(the default behavior without an explicit axis parameter):

>>> df.any()
A     True
B    False
dtype: boolean

Checking if each row contains at least one True element:

>>> df.any(axis=1)
0    True
1    True
dtype: boolean
Parameters:
  • axis ({index (0), columns (1)}) – Axis for the function to be applied on. For Series this parameter is unused and defaults to 0.

  • bool_only (bool. default False) – Include only boolean columns.

Returns:

Series indicating if any element is True per column.

Return type:

bigframes.pandas.Series