How to check whether a pandas DataFrame is empty?

You can use the attribute df.empty to check whether it’s empty or not:

if df.empty:
    print('DataFrame is empty!')

Source: Pandas Documentation

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)