Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Regression on np.logical_or, it behaves erraticly from 2.0, breaking backwards compatibility #54416

Open
3 tasks done
Tracked by #5
PabloRuizCuevas opened this issue Aug 4, 2023 · 1 comment
Open
3 tasks done
Tracked by #5
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member Regression Functionality that used to work in a prior pandas version

Comments

@PabloRuizCuevas
Copy link
Contributor

PabloRuizCuevas commented Aug 4, 2023

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

INSTALLED VERSIONS

commit : 0f43794
python : 3.11.2.final.0
python-bits : 64
OS : Linux
OS-release : 6.2.0-20-generic
Version : #20-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 6 07:48:48 UTC 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

@PabloRuizCuevas PabloRuizCuevas added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 4, 2023
@PabloRuizCuevas PabloRuizCuevas changed the title BUG: BUG: np.logical_or behaving erraticly from 2.0, breaking backwards compatibility Aug 4, 2023
@PabloRuizCuevas
Copy link
Contributor Author

PabloRuizCuevas commented Aug 4, 2023

@PabloRuizCuevas PabloRuizCuevas changed the title BUG: np.logical_or behaving erraticly from 2.0, breaking backwards compatibility BUG: Regresion on np.logical_or, it behaves erraticly from 2.0, breaking backwards compatibility Aug 4, 2023
@PabloRuizCuevas PabloRuizCuevas changed the title BUG: Regresion on np.logical_or, it behaves erraticly from 2.0, breaking backwards compatibility BUG: REGRESSION: on np.logical_or, it behaves erraticly from 2.0, breaking backwards compatibility Aug 4, 2023
@PabloRuizCuevas PabloRuizCuevas changed the title BUG: REGRESSION: on np.logical_or, it behaves erraticly from 2.0, breaking backwards compatibility BUG: regression on np.logical_or, it behaves erraticly from 2.0, breaking backwards compatibility Aug 4, 2023
@PabloRuizCuevas PabloRuizCuevas changed the title BUG: regression on np.logical_or, it behaves erraticly from 2.0, breaking backwards compatibility BUG: Regression on np.logical_or, it behaves erraticly from 2.0, breaking backwards compatibility Aug 4, 2023
@simonjayhawkins simonjayhawkins added the Regression Functionality that used to work in a prior pandas version label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

No branches or pull requests

2 participants