python

Pandas - How to check whether a pandas DataFrame is empty

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

data

df.DataFarame(data) if data are empty ,dose not raise an exception

Was this helpful?