Open
Description
Pandas version checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
import numpy as np
import pandas as pd
a = pd.DataFrame({"or":[False,True], "a":[True,True], "b":[True, False]})
# fails with: ValueError: cannot reindex on an axis with duplicate labels
np.logical_or(a[["a","b"]], a[2*["or"]])
# Erratic unpredictable behaviour with no fail :(
np.logical_or(a[["a","b"]], a[["or","a"]])
Issue Description
This used to work in pandas 1.x as a element wise logical operation, now is not working anymore. Even worst in some cases may be completely overlooked as it doesn't raise errors but another df with mixed nans and booleans
Expected Behavior
logical element wise operation that returns two colums with booleans