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

Jakub Okoński commented on ARROW-2298:
--------------------------------------

I would like for this to work:

 
{quote}{{In [1]: import pyarrow}}

{{In [2]: import pandas as pd}}

{{In [3]: df = pd.DataFrame(\{'a': [None, 1, 2, 3, None]})}}

{{In [4]: df.dtypes}}
{{Out[4]: }}
{{a    float64}}
{{dtype: object}}

{{In [5]: schema = pyarrow.schema([pyarrow.field(name='a', 
type=pyarrow.int64(), nullable=True)])}}

{{In [6]: pyarrow.Table.from_pandas(df, schema=schema, preserve_index=False)}}
{{---------------------------------------------------------------------------}}
{{ArrowInvalid                              Traceback (most recent call last)}}
{{<ipython-input-6-c779f0c872bb> in <module>()}}
{{----> 1 pyarrow.Table.from_pandas(df, schema=schema, preserve_index=False)}}

{{...}}

{{ArrowInvalid: ('Floating point value truncated', 'Conversion failed for 
column a with type float64')}}{quote}

> [Python] Add option to not consider NaN to be null when converting to an 
> integer Arrow type
> -------------------------------------------------------------------------------------------
>
>                 Key: ARROW-2298
>                 URL: https://issues.apache.org/jira/browse/ARROW-2298
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>            Reporter: Wes McKinney
>            Priority: Major
>             Fix For: 0.12.0
>
>
> Follow-on work to ARROW-2135



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

Reply via email to