Skip to content

BUG: numpy.iposinf and isneginf fail when NA types are in data frames #51382

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

Closed
2 of 3 tasks
n3world opened this issue Feb 14, 2023 · 1 comment
Closed
2 of 3 tasks

BUG: numpy.iposinf and isneginf fail when NA types are in data frames #51382

n3world opened this issue Feb 14, 2023 · 1 comment
Labels
NA - MaskedArrays Related to pd.NA and nullable extension arrays

Comments

@n3world
Copy link

n3world commented Feb 14, 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, pandas
numpy.isposinf(pandas.array([1.1,2,3,None])) # Works as expected
numpy.isposinf(pandas.DataFrame(pandas.array([1.1,2,3,None])))

Issue Description

numpy isposinf and isneginf fail when a pandas data frame is passed in but succeed when an array with the same values are passed as an argument

Expected Behavior

Expected a data frame of boolean values indicating which values match the condition to be returned

Installed Versions

INSTALLED VERSIONS ------------------ commit : 2e218d1 python : 3.10.6.final.0 python-bits : 64 OS : Linux OS-release : 5.15.0-60-generic Version : #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023 machine : x86_64 processor : x86_64 byteorder : little LC_ALL : None LANG : en_US.UTF-8 LOCALE : en_US.UTF-8

pandas : 1.5.3
numpy : 1.24.2
pytz : 2022.7.1
dateutil : 2.8.2
setuptools : 65.5.1
pip : 22.3.1
Cython : None
pytest : 7.2.1
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 11.0.0
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.10.0
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None
tzdata : None

@n3world n3world added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 14, 2023
@phofl
Copy link
Member

phofl commented Feb 23, 2023

Hi, thanks for your report. Unfortunately this is expected currently. This is related to how we convert from a DataFrame to numpy

@phofl phofl closed this as completed Feb 23, 2023
@phofl phofl added NA - MaskedArrays Related to pd.NA and nullable extension arrays and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NA - MaskedArrays Related to pd.NA and nullable extension arrays
Projects
None yet
Development

No branches or pull requests

2 participants