Check if a Pandas DataFrame is Empty

You can use the attribute df.empty to check whether it's empty or not. True if DataFrame is entirely empty (no items), meaning any of the axes are of length 0.

If you have only NaNs in your DataFrame, it is not considered as empty.

Using len()

You can use the len function for checking DataFrame is empty or not. It's much faster than df.empty.
 (C) 2021    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About