pyhton if data frame is empty then code example Example: how to check for empty dataframe df_empty = pd.DataFrame({'A' : []}) df_empty.empty # True