Using dataframe.empty rather than boolean test on dataframe itself