Verifique el marco de datos vacío
df.empty == True
Light Louse
df.empty == True
df_empty = pd.DataFrame({'A' : []})
df_empty.empty # True
if df.empty:
print('Your df is empty...')
>>> df_empty = pd.DataFrame({'A' : []})
>>> df_empty
Empty DataFrame
Columns: [A]
Index: []
>>> df_empty.empty
True