-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
BugCompatpandas objects compatability with Numpy or Python functionspandas objects compatability with Numpy or Python functionsRegressionFunctionality that used to work in a prior pandas versionFunctionality that used to work in a prior pandas version
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
Installed Versions
Metadata
Metadata
Assignees
Labels
BugCompatpandas objects compatability with Numpy or Python functionspandas objects compatability with Numpy or Python functionsRegressionFunctionality that used to work in a prior pandas versionFunctionality that used to work in a prior pandas version