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