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

ASF GitHub Bot commented on ARROW-2007:
---------------------------------------

pitrou commented on a change in pull request #1509: ARROW-2007: [Python] 
Implement float32 conversions, use NumPy dtype when possible for inner arrays
URL: https://github.com/apache/arrow/pull/1509#discussion_r163915837
 
 

 ##########
 File path: python/pyarrow/tests/test_array.py
 ##########
 @@ -507,6 +507,19 @@ def test_array_from_numpy_datetimeD():
     assert result.equals(expected)
 
 
+def test_array_from_py_float32():
+    data = [[1.2, 3.4], [9.0, 42.0]]
+    arr1 = pa.array(data[0], type=pa.float32())
+    arr2 = pa.array(data, type=pa.list_(pa.float32()))
+
+    expected1 = np.array(data[0], dtype=np.float32)
+    expected2 = pd.Series([np.array(data[0], dtype=np.float32),
+                           np.array(data[1], dtype=np.float32)])
+
+    assert arr1.equals(pa.array(expected1))
 
 Review comment:
   Do we want to check that `arr1.type` is exactly `pa.float32()` here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> [Python] Sequence converter for float32 not implemented
> -------------------------------------------------------
>
>                 Key: ARROW-2007
>                 URL: https://issues.apache.org/jira/browse/ARROW-2007
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>            Reporter: Wes McKinney
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> See bug report in [https://github.com/apache/arrow/issues/1431,] example
> {code:java}
> import pyarrow as pa
> l = [[1.2, 3.4], [9.0, 42.0]]
> pa.array(l, type=pa.list_(pa.float32())){code}
>  



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

Reply via email to