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: Pyarrow Float dataframe -> to_numpy yields Object type #55802

Closed
2 of 3 tasks
s-banach opened this issue Nov 2, 2023 · 1 comment
Closed
2 of 3 tasks

BUG: Pyarrow Float dataframe -> to_numpy yields Object type #55802

s-banach opened this issue Nov 2, 2023 · 1 comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@s-banach
Copy link

s-banach commented Nov 2, 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 pyarrow as pa
import pandas as pd

s = pd.Series([1, 2, 3], dtype=pd.ArrowDtype(pa.float64()))
pd.DataFrame({"x": s, "y": s}).to_numpy().dtype

"""dtype('O')"""

Issue Description

Other issues such as #54808 mention to_numpy() yielding object types in the presence of nulls.
Here I got object types even without nulls.

Expected Behavior

Output should be np.float64 array.

Installed Versions

INSTALLED VERSIONS

commit : a60ad39
python : 3.11.3.final.0
python-bits : 64
OS : Linux
OS-release : 4.18.0-425.19.2.el8_7.x86_64
Version : #1 SMP Fri Mar 17 01:52:38 EDT 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.utf8
LOCALE : en_US.UTF-8

pandas : 2.1.2
numpy : 1.25.2
pytz : 2023.3
dateutil : 2.8.2
setuptools : 67.6.1
pip : 23.0.1
Cython : 3.0.0
pytest : 7.4.0
hypothesis : None
sphinx : 6.2.1
blosc : None
feather : None
xlsxwriter : 3.1.2
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.8.0
pandas_datareader : None
bs4 : 4.12.2
bottleneck : None
dataframe-api-compat: None
fastparquet : None
fsspec : 2023.6.0
gcsfs : None
matplotlib : 3.7.2
numba : 0.58.0
numexpr : None
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 14.0.0
pyreadstat : 1.2.1
pyxlsb : None
s3fs : 2023.6.0
scipy : 1.11.2
sqlalchemy : 2.0.16
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.3
qtpy : None
pyqt5 : None

@s-banach s-banach added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Nov 2, 2023
@mroeschke
Copy link
Member

Thanks for the report. The core issue is based in #22791 so will close in favor of that issue

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
Projects
None yet
Development

No branches or pull requests

2 participants