October 2019
Beginner to intermediate
674 pages
16h 43m
English
The all() and any() functions help us test for the presence of False values or zeros in a DataFrame. If all the values along the chosen axis are True, then the all() function returns True. The any() function requires at least a single value to be True to return True. Let's apply all() and any() on the following DataFrame:
all_any = pd.DataFrame({"A": [True, False, False, True, True], "B": [1, 1, 1, 1, 1], "C": [10, 11, 20, 22, 33], "D": ["abc", "xyz", "pqr", "ijk", "def"], "E": [False, False, False, False, False]})all_any
This results in the following output:

All the values are True in columns B, C, and D. ...
Read now
Unlock full access