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

Joris Van den Bossche commented on ARROW-6349:
----------------------------------------------

The {{pyarrow.serialize()}} function is deprecated (and thus not worth 
enhancing it), but also the creation of a Tensor object fails with the same 
error message (so renamed the issue to focus on this):

{code}
In [47]: pa.Tensor.from_numpy(b)
---------------------------------------------------------------------------
ArrowInvalid                              Traceback (most recent call last)
<ipython-input-47-48777b286890> in <module>
----> 1 pa.Tensor.from_numpy(b)

~/scipy/repos/arrow/python/pyarrow/tensor.pxi in pyarrow.lib.Tensor.from_numpy()

~/scipy/repos/arrow/python/pyarrow/error.pxi in pyarrow.lib.check_status()

ArrowInvalid: Negative ndarray strides not supported
{code}

> [Python] Conversion of numpy array to pyarrow.Tensor: Negative ndarray 
> strides not supported
> --------------------------------------------------------------------------------------------
>
>                 Key: ARROW-6349
>                 URL: https://issues.apache.org/jira/browse/ARROW-6349
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>         Environment: Ubuntu 16.04, python 3.6.6, numpy 1.14.6, pyarrow 0.11.1
>            Reporter: YUTING ZHANG
>            Priority: Major
>
> When indexing a np.ndarray with negative stride, arrow cannot serialize it. 
> However, this could be a common use case for reversing along an axis. 
>  
> Code:
> {code:java}
> import pyarrow
> import numpy as np
> a=np.zeros([500,600,3])
> b=a[:,:,::-1]
> pyarrow.serialize(b)
> {code}
>  
> Error:
> {code:java}
> ArrowInvalid Traceback (most recent call last)
> <ipython-input-7-bf252de95dc1> in <module>()
> ----> 1 pyarrow.serialize(b)
> ~/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/pyarrow/serialization.pxi
>  in pyarrow.lib.serialize()
> ~/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/pyarrow/error.pxi in 
> pyarrow.lib.check_status()
> ArrowInvalid: Negative ndarray strides not supported
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to