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

closes #5808