[ 
https://issues.apache.org/jira/browse/ARROW-2722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wes McKinney updated ARROW-2722:
--------------------------------
    Summary: [Python] ndarray to arrow conversion fails when downcasted from 
pandas to_numeric  (was: ndarray to arrow conversion fails when downcasted from 
pandas to_numeric)

> [Python] ndarray to arrow conversion fails when downcasted from pandas 
> to_numeric
> ---------------------------------------------------------------------------------
>
>                 Key: ARROW-2722
>                 URL: https://issues.apache.org/jira/browse/ARROW-2722
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++, Python
>    Affects Versions: 0.9.0
>         Environment: Windows 10 64-bit
>            Reporter: Augusto Radtke
>            Priority: Major
>
> The following snippet:
> {code:java}
> import numpy as np
> import pandas as pd
> import pyarrow as pa
> pa.array(pd.to_numeric(pd.Series(np.array([65536,2,3], dtype=np.uint64)), 
> downcast='unsigned'), 
> from_pandas=True, type='uint32')
> {code}
> fails to convert with message:
> {noformat}
> ArrowNotImplementedError Traceback (most recent call last)
> <ipython-input-2-b259c5cb7044> in <module>()
> 4 
> 5 pa.array(pd.to_numeric(pd.Series(np.array([65536,2,3], dtype=np.uint64)), 
> downcast='unsigned'), 
> ----> 6 from_pandas=True, type='uint32')
> array.pxi in pyarrow.lib.array()
> array.pxi in pyarrow.lib._ndarray_to_array()
> error.pxi in pyarrow.lib.check_status()
> ArrowNotImplementedError: Unsupported numpy type 6{noformat}
>  
> This is a Windows 64-bit machine, running Python 3.6.5, pyarrow 0.9.0, pandas 
> 0.23.1 and numpy 1.14.5.
> Seems to be fine for uint16 or uint8 downcasting. Unfortunately I didn't had 
> the time to dig deeper or try on a Linux machine but it feels like its 
> related to the LLP64 model.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to