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

Cannot convert pd.DataFrame with complex128 cells to pa.Table #29845

Open
asfimport opened this issue Oct 8, 2021 · 0 comments
Open

Cannot convert pd.DataFrame with complex128 cells to pa.Table #29845

asfimport opened this issue Oct 8, 2021 · 0 comments

Comments

@asfimport
Copy link

Example:

 

import numpy as np
import pandas as pd
import pyarrow as pa

data = np.array([1 + 1j])
df = pd.DataFrame(data)
table = pa.Table.from_pandas(df)
print(table)

Throws the following error:

Traceback (most recent call last):
 File "/Users/Henrikh/Desktop/tmp.py", line 7, in <module>
 table = pa.Table.from_pandas(df)
 File "pyarrow/table.pxi", line 1553, in pyarrow.lib.Table.from_pandas
 File "/usr/local/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 594, in dataframe_to_arrays
 arrays = [convert_column(c, f)
 File "/usr/local/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 594, in <listcomp>
 arrays = [convert_column(c, f)
 File "/usr/local/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 581, in convert_column
 raise e
 File "/usr/local/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 575, in convert_column
 result = pa.array(col, type=type_, from_pandas=True, safe=safe)
 File "pyarrow/array.pxi", line 302, in pyarrow.lib.array
 File "pyarrow/array.pxi", line 79, in pyarrow.lib._ndarray_to_array
 File "pyarrow/array.pxi", line 67, in pyarrow.lib._ndarray_to_type
 File "pyarrow/error.pxi", line 118, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: ('Unsupported numpy type 15', 'Conversion failed for column 0 with type complex128')

 

Reporter: Henrikh Kantuni

Note: This issue was originally created as ARROW-14268. Please see the migration documentation for further details.

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

1 participant