You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/02/10 08:47:23 UTC
[GitHub] [arrow] bhavitvyamalik opened a new issue #9462: pyarrow.lib.ArrowInvalid: Could not convert with type numpy.ndarray: tried to convert to int
bhavitvyamalik opened a new issue #9462:
URL: https://github.com/apache/arrow/issues/9462
Hi,
I came to know that pyarrow has this limitation of not storing nD arrays. After looking into this issue, I decided to represent a nD array as a list of arrays i.e.
```
data = np.zeros((5, 3), dtype=np.uint8)
data = list(data)
```
inorder to preserve the dtype but when it comes to typecasting and writing it into array (from list) `pyarrow.array(data, type=type)` it gives the following error:
`pyarrow.lib.ArrowInvalid: Could not convert [0 0 0] with type numpy.ndarray: tried to convert to int`
Is there any way to avoid this issue? I just want to preserve the dtype from numpy array before converting it to list so that while writing it to pyarrow array format I can recognise its dtype and subsequently write it in that numpy dtype format.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] emkornfield closed issue #9462: pyarrow.lib.ArrowInvalid: Could not convert with type numpy.ndarray: tried to convert to int
Posted by GitBox <gi...@apache.org>.
emkornfield closed issue #9462:
URL: https://github.com/apache/arrow/issues/9462
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] emkornfield commented on issue #9462: pyarrow.lib.ArrowInvalid: Could not convert with type numpy.ndarray: tried to convert to int
Posted by GitBox <gi...@apache.org>.
emkornfield commented on issue #9462:
URL: https://github.com/apache/arrow/issues/9462#issuecomment-777200781
Hi @bhavitvyamalik we prefer questions like this get asked through the user@arrow.apache.org mailing list. It seems that you should also be including what type you are passing to pyarrow.array(...)
On an older version of arrow the following works for me with pyarrow3:
```
>>> pyarrow.array(list(data))
<pyarrow.lib.ListArray object at 0x11866c980>
[
[
0,
0,
0
],
[
0,
0,
0
],
[
0,
0,
0
],
[
0,
0,
0
],
[
0,
0,
0
]
]
>>> pyarrow.array(list(data)).type
ListType(list<item: uint8>)
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] emkornfield commented on issue #9462: pyarrow.lib.ArrowInvalid: Could not convert with type numpy.ndarray: tried to convert to int
Posted by GitBox <gi...@apache.org>.
emkornfield commented on issue #9462:
URL: https://github.com/apache/arrow/issues/9462#issuecomment-777258679
Yes you need to subscribe to the list to be able to send mail.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] bhavitvyamalik commented on issue #9462: pyarrow.lib.ArrowInvalid: Could not convert with type numpy.ndarray: tried to convert to int
Posted by GitBox <gi...@apache.org>.
bhavitvyamalik commented on issue #9462:
URL: https://github.com/apache/arrow/issues/9462#issuecomment-777212022
Mail delivery to this address was failing yesterday. Do I need to subscribe to mailing list inorder to send mails to this address?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org