You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (JIRA)" <ji...@apache.org> on 2017/06/26 18:00:00 UTC

[jira] [Commented] (ARROW-1156) pyarrow.Array.from_pandas should take a type parameter

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

Wes McKinney commented on ARROW-1156:
-------------------------------------

Note that this functionality already exists in the {{pyarrow.array} function

{code}
In [8]: arr
Out[8]: array([None, None, None, None, None, None, None, None, None, None], dtype=object)

In [9]: pa.array(arr)
Out[9]: 
<pyarrow.lib.NullArray object at 0x7f10bd026548>
[
  NA,
  NA,
  NA,
  NA,
  NA,
  NA,
  NA,
  NA,
  NA,
  NA
]

In [10]: pa.array(arr, type=pa.float64())
Out[10]: 
<pyarrow.lib.DoubleArray object at 0x7f10bd026688>
[
  NA,
  NA,
  NA,
  NA,
  NA,
  NA,
  NA,
  NA,
  NA,
  NA
]
{code}

> pyarrow.Array.from_pandas should take a type parameter
> ------------------------------------------------------
>
>                 Key: ARROW-1156
>                 URL: https://issues.apache.org/jira/browse/ARROW-1156
>             Project: Apache Arrow
>          Issue Type: New Feature
>    Affects Versions: 0.4.0
>            Reporter: Wenchen Fan
>
> It's convenient to infer the data type so that users can just write {{pyarrow.Array.from_pandas(arr)}}, however, sometimes users want fine-grained control, e.g., if we have an object type numpy array, whose values are all null. When we convert it to an arrow column vector, we may need a specific type instead of NullType.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)