ryankshah opened a new issue #12674:
URL: https://github.com/apache/arrow/issues/12674
Hi all,
For reference I am using `numpy=1.22.3` and `pyarrow=7.0.0`.
I am aiming to create a dataset (and store in feather format) for STFT data
from digital signal analysis, with the STFT array in the type/shape: `<class
'numpy.ndarray'> \\ (10001, 401)`. An example of this data is:
```
[[ 1.24496163e-03+0.0000000e+00j 1.17749616e-04+0.0000000e+00j
8.92068347e-05+0.0000000e+00j ... -3.55575146e-04+0.0000000e+00j
-3.53000971e-04+0.0000000e+00j -1.35809695e-03+0.0000000e+00j]
[-1.20925368e-03+2.0470628e-05j -5.52154524e-05-3.7754296e-05j
-7.05739149e-05-7.2288349e-05j ... 2.85753951e-04+4.1393949e-05j
1.60366966e-04-2.7969104e-04j 1.15900207e-03+2.3369875e-04j]
[ 1.19788689e-03+3.3121873e-05j -6.23480264e-06+4.2733776e-05j
4.23972924e-05+8.2590450e-05j ... -1.44452570e-04+8.9506881e-05j
-1.42675699e-05+1.8458923e-04j -9.61950631e-04-1.2690650e-04j]
...
[-1.11952168e-05+1.8826026e-06j 3.46628576e-06-2.0878474e-06j
-1.54314409e-06-2.8386687e-06j ... -1.41124383e-06-2.3261330e-06j
-5.40845519e-07-2.5624531e-06j 1.46134671e-05-1.2955890e-06j]
[ 8.70186886e-06-2.8798408e-06j -3.47046830e-06+4.1321928e-06j
1.99560964e-06-2.9683741e-07j ... -3.09421989e-06+8.9018937e-07j
-1.19136712e-06+2.9354976e-06j -1.56483602e-05+6.8048553e-07j]
[-6.49670437e-06+0.0000000e+00j 4.49650315e-06+0.0000000e+00j
-2.71528188e-06+0.0000000e+00j ... 6.58240697e-06+0.0000000e+00j
3.21866310e-06+0.0000000e+00j 1.57587510e-05+0.0000000e+00j]]
```
This data is being stored in a dataframe and written to feather as follows:
`feather.write_feather(pd.DataFrame([{'id': i, 'movement': y, 'distance':
movedist, 'speed': speed, 'signal': Zxx}]), dataset_file)` with the
`dataset_file` reference pointing to a `with open(.., 'wb') as dataset_file`.
The error I am getting is:
> Traceback (most recent call last):
> File "analyse_cvnn.py", line 108, in <module>
> feather.write_feather(pd.DataFrame([{'id': i, 'movement': y,
'distance': movedist, 'speed': speed, 'signal': Zxx}]), dataset_file)
> File "C:\Python38\lib\site-packages\pyarrow\feather.py", line 154, in
write_feather
> table = Table.from_pandas(df, preserve_index=False)
> File "pyarrow\table.pxi", line 1782, in pyarrow.lib.Table.from_pandas
> File "C:\Python38\lib\site-packages\pyarrow\pandas_compat.py", line 594,
in dataframe_to_arrays
> arrays = [convert_column(c, f)
> File "C:\Python38\lib\site-packages\pyarrow\pandas_compat.py", line 594,
in <listcomp>
> arrays = [convert_column(c, f)
> File "C:\Python38\lib\site-packages\pyarrow\pandas_compat.py", line 581,
in convert_column
> raise e
> File "C:\Python38\lib\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 312, in pyarrow.lib.array
> File "pyarrow\array.pxi", line 83, in pyarrow.lib._ndarray_to_array
> File "pyarrow\error.pxi", line 120, in pyarrow.lib.check_status
> pyarrow.lib.ArrowNotImplementedError: ('Unsupported numpy type 14',
'Conversion failed for column signal with type object')
I am running Windows 10 x64, 16GB RAM, Python 3.8.2
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]