w3resource

Pandas DataFrame property: empty

DataFrame - empty property

The empty property indicates whether DataFrame is empty or not.

True if DataFrame is entirely empty (no items), meaning any of the axes are of length 0.

Syntax:

DataFrame.empty

Returns: bool,
If DataFrame is empty, return True, if not return False.

Notes

If DataFrame contains only NaNs, it is still not considered empty.

Example:


Download the above Notebook from here.

Previous: DataFrame - memory_usage() function
Next: DataFrame - astype() function