You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Rok Mihevc (Jira)" <ji...@apache.org> on 2023/01/11 07:20:05 UTC

[jira] [Commented] (ARROW-2277) [Python] Tensor.from_numpy doesn't support struct arrays

    [ https://issues.apache.org/jira/browse/ARROW-2277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17659304#comment-17659304 ] 

Rok Mihevc commented on ARROW-2277:
-----------------------------------

This issue has been migrated to [issue #18233|https://github.com/apache/arrow/issues/18233] on GitHub. Please see the [migration documentation|https://github.com/apache/arrow/issues/14542] for further details.

> [Python] Tensor.from_numpy doesn't support struct arrays
> --------------------------------------------------------
>
>                 Key: ARROW-2277
>                 URL: https://issues.apache.org/jira/browse/ARROW-2277
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>    Affects Versions: 0.8.0
>            Reporter: Antoine Pitrou
>            Priority: Major
>
> {code:python}
> >>> dt = np.dtype([('x', np.int8), ('y', np.float32)])
> >>> dt.itemsize
> 5
> >>> arr = np.arange(5*10, dtype=np.int8).view(dt)
> >>> pa.Tensor.from_numpy(arr)
> Traceback (most recent call last):
>   File "<ipython-input-8-744d4c7972b7>", line 1, in <module>
>     pa.Tensor.from_numpy(arr)
>   File "array.pxi", line 523, in pyarrow.lib.Tensor.from_numpy
>   File "error.pxi", line 85, in pyarrow.lib.check_status
> ArrowNotImplementedError: /home/antoine/arrow/cpp/src/arrow/python/numpy_convert.cc:250 code: GetTensorType(reinterpret_cast<PyObject*>(PyArray_DESCR(ndarray)), &type)
> Unsupported numpy type 20
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)