BUG: isna
doesn't detect pyarrow.NA
produced by 0/0
#59891
Labels
Bug
PDEP missing values
Issues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint
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
Issue Description
I deal with tables with a lot of missing data, and using
pyarrow
backend is a must. However, I recently noticed that some intermediate results are not processed as they should be: applyingisna
to therate
column above results inpyarrow.NaN
being see as a regular number, whereasnumpy.nan
is processed like expected. Creating a dataframe from scratch though behaves like it should.Expected Behavior
The documentation says the following:
pandas/pandas/core/dtypes/missing.py
Lines 101 to 178 in 0691c5c
and I'd expect
NaN
to be seen the same regardless of the actual dtype; this is a well-definedIEEE 754
object. There is a hint to what might be causing it here: apache/arrow#35535 (comment)Installed Versions
INSTALLED VERSIONS
commit : 0691c5c
python : 3.12.6
python-bits : 64
OS : Linux
OS-release : 6.10.10-arch1-1
Version : #1 SMP PREEMPT_DYNAMIC Thu, 12 Sep 2024 17:21:02 +0000
machine : x86_64
processor :
byteorder : little
LC_ALL : en_US.UTF-8
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.3
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0.post0
pip : 24.1.2
Cython : None
sphinx : None
IPython : 8.26.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.3.1
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.4
lxml.etree : None
matplotlib : 3.9.1
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.5
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : 17.0.0
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.14.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: