ENH: bool sparse now supports logical op by sinhrks · Pull Request #14000 · pandas-dev/pandas (original) (raw)

implemented bool (logical and / or) op for bool SparseArray. Currently it raises if sp_index are different.

s1 = pd.SparseArray([True, True, True, True, True], dtype=np.bool, fill_value=False)
s2 = pd.SparseArray([False, True, False, True, True], dtype=np.bool, fill_value=False)
s1 & s2
# ValueError: operands could not be broadcast together with shapes (5,) (3,)