I have an if statement where it checks if the data frame is not empty. The way I do it is the following:
if
if dataframe.empty: pass else: #do
You can use the attribute dataframe.empty to check whether it's empty or not:
dataframe.empty
if not dataframe.empty: #do something
Or
if len(dataframe) != 0: #do something
if len(dataframe.index) != 0: #do something