Search⌘ K

The all() Method with Pandas Series

Explore the pandas Series all method to understand how it evaluates whether all elements are True, including its behavior with empty Series. Learn the comparison with Python's built-in all function and how any differs in logic.

We'll cover the following...

Try it yourself

Try executing the code below to see the result.

Python 3.5
import pandas as pd
s = pd.Series([], dtype='float64')
print('full' if s.all() else 'empty')

Explanation

The pandas.Series.all documentation says the following:

  • It returns whether all elements are True, potentially ...