BUG: fix issue of boolean comparison on empty DataFrames (:issue:`5808`)