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

[Python][C++] Data corruption when initializing from float16 NumPy array or pandas Series #40106

Closed
Wainberg opened this issue Feb 17, 2024 · 2 comments

Comments

@Wainberg
Copy link

Wainberg commented Feb 17, 2024

Describe the bug, including details regarding any error messages, version, and platform.

>>> import pyarrow as pa
>>> import numpy as np
>>> pa.array(np.array([1], dtype='float16'))
<pyarrow.lib.HalfFloatArray object at 0x7f7bc9ae7dc0>
[
  15360
]
>>> pa.array([np.float16(1)])
<pyarrow.lib.HalfFloatArray object at 0x7fd6bd266800>
[
  15360
]
>>> pa.array([np.float16(1)], type=pa.float16())
<pyarrow.lib.HalfFloatArray object at 0x7f7bc9ae7ee0>
[
  15360
]
>>> pa.array(pd.Series([1], dtype='float16'))
<pyarrow.lib.HalfFloatArray object at 0x7fd6bd266da0>
[
  15360
]

This is on pyarrow 14.0.2, NumPy 1.26.4, pandas 2.2.0, Python 3.12.

Component(s)

Python


Duplicate of:

@Wainberg Wainberg changed the title Data corruption when initializing from float16 NumPy array Data corruption when initializing from float16 NumPy array or pandas Series Feb 18, 2024
@mariosasko
Copy link

This has already been reported in #36753 (the print is not implemented, but the values are correctly stored)

@jorisvandenbossche jorisvandenbossche changed the title Data corruption when initializing from float16 NumPy array or pandas Series [Python][C++] Data corruption when initializing from float16 NumPy array or pandas Series Feb 20, 2024
@jorisvandenbossche
Copy link
Member

Closing as a duplicate of #36753 then

@jorisvandenbossche jorisvandenbossche closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants