Panel.all(axis=None, bool_only=None, skipna=None, level=None, **kwargs)[source]

Return whether all elements are True over series or dataframe axis.

Returns True if all elements within a series or along a dataframe axis are non-zero, not-empty or not-False.


axis : int, default 0

Select the axis which can be 0 for indices and 1 for columns.

skipna : boolean, default True

Exclude NA/null values. If an entire row/column is NA, the result will be NA.

level : int or level name, default None

If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a DataFrame.

bool_only : boolean, default None

Include only boolean columns. If None, will attempt to use everything, then use only boolean data. Not implemented for Series.

**kwargs : any, default None

Additional keywords have no effect but might be accepted for compatibility with NumPy.


all : DataFrame or Panel (if level specified)

See also

Return True if all elements are True
Return True if one (or more) elements are True



>>> pd.Series([True, True]).all()
>>> pd.Series([True, False]).all()


Create a dataframe from a dictionary.

>>> df = pd.DataFrame({'col1': [True, True], 'col2': [True, False]})
>>> df
   col1   col2
0  True   True
1  True  False

Default behaviour checks if column-wise values all return True.

>>> df.all()
col1     True
col2    False
dtype: bool

Adding axis=1 argument will check if row-wise values all return True.

>>> df.all(axis=1)
0     True
1    False
dtype: bool
Scroll To Top