pandas 1.4.2

ParametersReturnsBackRef
all(self, *, skipna: 'bool' = True, **kwargs)

Returns True unless there is at least one element that is falsey. By default, NAs are skipped. If skipna=False is specified and missing values are present, similar Kleene logic <boolean.kleene> is used as for logical operations.

versionchanged

Parameters

skipna : bool, default True

Exclude NA values. If the entire array is NA and :None:None:`skipna` is True, then the result will be True, as for an empty array. If :None:None:`skipna` is False, the result will still be False if there is at least one element that is falsey, otherwise NA will be returned if there are NA's present.

**kwargs : any, default None

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

Returns

bool or : attr:`pandas.NA`

Return whether all elements are truthy.

See Also

BooleanArray.any

Return whether any element is truthy.

numpy.all

Numpy version of this method.

Examples

The result indicates whether all elements are truthy (and by default skips NAs):

This example is valid syntax, but we were not able to check execution
>>> pd.array([True, True, pd.NA]).all()
True
This example is valid syntax, but we were not able to check execution
>>> pd.array([1, 1, pd.NA]).all()
True
This example is valid syntax, but we were not able to check execution
>>> pd.array([True, False, pd.NA]).all()
False
This example is valid syntax, but we were not able to check execution
>>> pd.array([], dtype="boolean").all()
True
This example is valid syntax, but we were not able to check execution
>>> pd.array([pd.NA], dtype="boolean").all()
True
This example is valid syntax, but we were not able to check execution
>>> pd.array([pd.NA], dtype="Float64").all()
True

With skipna=False , the result can be NA if this is logically required (whether pd.NA is True or False influences the result):

This example is valid syntax, but we were not able to check execution
>>> pd.array([True, True, pd.NA]).all(skipna=False)
<NA>
This example is valid syntax, but we were not able to check execution
>>> pd.array([1, 1, pd.NA]).all(skipna=False)
<NA>
This example is valid syntax, but we were not able to check execution
>>> pd.array([True, False, pd.NA]).all(skipna=False)
False
This example is valid syntax, but we were not able to check execution
>>> pd.array([1, 0, pd.NA]).all(skipna=False)
False
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.core.arrays.masked.BaseMaskedArray.any

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/arrays/masked.py#960
type: <class 'function'>
Commit: