Return whether all elements are True, potentially over an axis. Returns True unless there at least one element within a series or along a Dataframe axis that is False or equivalent (e.g. zero or empty). Parameters ---------- axis : {0 or 'in
(
self,
axis: Axis = 0,
bool_only: bool = False,
skipna: bool = True,
**kwargs,
)
| 7630 | |
| 7631 | @deprecate_nonkeyword_arguments(Pandas4Warning, allowed_args=["self"], name="all") |
| 7632 | def all( |
| 7633 | self, |
| 7634 | axis: Axis = 0, |
| 7635 | bool_only: bool = False, |
| 7636 | skipna: bool = True, |
| 7637 | **kwargs, |
| 7638 | ) -> bool: |
| 7639 | """ |
| 7640 | Return whether all elements are True, potentially over an axis. |
| 7641 | |
| 7642 | Returns True unless there at least one element within a series or |
| 7643 | along a Dataframe axis that is False or equivalent (e.g. zero or |
| 7644 | empty). |
| 7645 | |
| 7646 | Parameters |
| 7647 | ---------- |
| 7648 | axis : {0 or 'index', 1 or 'columns', None}, default 0 |
| 7649 | Indicate which axis or axes should be reduced. For `Series` this parameter |
| 7650 | is unused and defaults to 0. |
| 7651 | |
| 7652 | * 0 / 'index' : reduce the index, return a Series whose index is the |
| 7653 | original column labels. |
| 7654 | * 1 / 'columns' : reduce the columns, return a Series whose index is the |
| 7655 | original index. |
| 7656 | * None : reduce all axes, return a scalar. |
| 7657 | |
| 7658 | bool_only : bool, default False |
| 7659 | Include only boolean columns. Not implemented for Series. |
| 7660 | skipna : bool, default True |
| 7661 | Exclude NA/null values. If the entire row/column is NA and skipna is |
| 7662 | True, then the result will be True, as for an empty row/column. |
| 7663 | If skipna is False, then NA are treated as True, because these are not |
| 7664 | equal to zero. |
| 7665 | **kwargs : any, default None |
| 7666 | Additional keywords have no effect but might be accepted for |
| 7667 | compatibility with NumPy. |
| 7668 | |
| 7669 | Returns |
| 7670 | ------- |
| 7671 | Series or scalar |
| 7672 | If axis=None, then a scalar boolean is returned. |
| 7673 | Otherwise a Series is returned with index matching the index argument. |
| 7674 | |
| 7675 | See Also |
| 7676 | -------- |
| 7677 | Series.all : Return True if all elements are True. |
| 7678 | DataFrame.any : Return True if one (or more) elements are True. |
| 7679 | |
| 7680 | Examples |
| 7681 | -------- |
| 7682 | **Series** |
| 7683 | |
| 7684 | >>> pd.Series([True, True]).all() |
| 7685 | True |
| 7686 | >>> pd.Series([True, False]).all() |
| 7687 | False |
| 7688 | >>> pd.Series([], dtype="float64").all() |
| 7689 | True |