Examples
Whether each column contains at least one True element (the default).
import numpy as np
import pandas as pd
df = pd.DataFrame({"P": [2, 3], "Q": [0, 3], "R": [0, 0]})
df
df.any()
Aggregating over the columns:
df = pd.DataFrame({"P": [True, False], "Q": [2, 3]})
df
df.any(axis='columns')
df = pd.DataFrame({"P": [True, False], "Q": [2, 0]})
df
df.any(axis='columns')
Aggregating over the entire DataFrame with axis=None:
df.any(axis=None)
pd.DataFrame([]).any()