We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
is_numeric_dtype
ArrowDtypes
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
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.
import pandas as pd import pyarrow as pa from pandas.api.types import is_numeric_dtype # false is_numeric_dtype(pd.ArrowDtype(pa.int64())) is_numeric_dtype(pd.ArrowDtype(pa.float64())) is_numeric_dtype(pd.ArrowDtype(pa.int32())) is_numeric_dtype(pd.ArrowDtype(pa.float32())) # true pd.ArrowDtype(pa.int64())._is_numeric pd.ArrowDtype(pa.float64())._is_numeric pd.ArrowDtype(pa.int32())._is_numeric pd.ArrowDtype(pa.float32())._is_numeric
Passing a numeric ArrowDtype to is_numeric_dtype returns False, even when its _is_numeric attribute is True.
ArrowDtype
_is_numeric
I would assume that the return value of is_numeric_dtype would be consistent with the value of _is_numeric for these dtypes.
commit : 8dab54d python : 3.10.8.final.0 python-bits : 64 OS : Linux OS-release : 4.15.0-189-generic Version : #200-Ubuntu SMP Wed Jun 22 19:53:37 UTC 2022 machine : x86_64 processor : x86_64 byteorder : little LC_ALL : None LANG : en_US.UTF-8 LOCALE : en_US.UTF-8
pandas : 1.5.2 numpy : 1.23.5 pytz : 2022.7 dateutil : 2.8.2 setuptools : 65.6.3 pip : 22.3.1 Cython : None pytest : 7.2.0 hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : None lxml.etree : None html5lib : None pymysql : None psycopg2 : None jinja2 : 3.1.2 IPython : 8.8.0 pandas_datareader: None bs4 : None bottleneck : None brotli : fastparquet : 2022.12.0 fsspec : 2022.11.0 gcsfs : None matplotlib : None numba : 0.56.4 numexpr : 2.8.3 odfpy : None openpyxl : None pandas_gbq : None pyarrow : 10.0.1 pyreadstat : None pyxlsb : None s3fs : 2022.11.0 scipy : 1.10.0 snappy : sqlalchemy : 1.4.46 tables : 3.7.0 tabulate : None xarray : 2022.12.0 xlrd : None xlwt : None zstandard : None tzdata : None
The text was updated successfully, but these errors were encountered:
partition_quantiles
is_integer_dtype
False
Successfully merging a pull request may close this issue.
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
Passing a numeric
ArrowDtype
tois_numeric_dtype
returns False, even when its_is_numeric
attribute is True.Expected Behavior
I would assume that the return value of
is_numeric_dtype
would be consistent with the value of_is_numeric
for these dtypes.Installed Versions
INSTALLED VERSIONS
commit : 8dab54d
python : 3.10.8.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-189-generic
Version : #200-Ubuntu SMP Wed Jun 22 19:53:37 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.5.2
numpy : 1.23.5
pytz : 2022.7
dateutil : 2.8.2
setuptools : 65.6.3
pip : 22.3.1
Cython : None
pytest : 7.2.0
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.8.0
pandas_datareader: None
bs4 : None
bottleneck : None
brotli :
fastparquet : 2022.12.0
fsspec : 2022.11.0
gcsfs : None
matplotlib : None
numba : 0.56.4
numexpr : 2.8.3
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 10.0.1
pyreadstat : None
pyxlsb : None
s3fs : 2022.11.0
scipy : 1.10.0
snappy :
sqlalchemy : 1.4.46
tables : 3.7.0
tabulate : None
xarray : 2022.12.0
xlrd : None
xlwt : None
zstandard : None
tzdata : None
The text was updated successfully, but these errors were encountered: