You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2021/08/18 04:18:50 UTC

[arrow-cookbook] branch main updated: Explicit array creation (#2)

This is an automated email from the ASF dual-hosted git repository.

westonpace pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-cookbook.git


The following commit(s) were added to refs/heads/main by this push:
     new 4e7b366  Explicit array creation (#2)
4e7b366 is described below

commit 4e7b36661b4f224de66dabd355fedee453047658
Author: Nathanaƫl Leaute <n....@gmail.com>
AuthorDate: Wed Aug 18 06:18:46 2021 +0200

    Explicit array creation (#2)
---
 python/source/io.rst | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/python/source/io.rst b/python/source/io.rst
index 4edc444..b3eab15 100644
--- a/python/source/io.rst
+++ b/python/source/io.rst
@@ -21,6 +21,11 @@ Given an array with 100 numbers, from 0 to 99
 
 .. testcode::
 
+    import numpy as np
+    import pyarrow as pa
+
+    arr = pa.array(np.arange(100))
+
     print(f"{arr[0]} .. {arr[-1]}")
 
 .. testoutput::
@@ -122,6 +127,11 @@ Given an array with 100 numbers, from 0 to 99
 
 .. testcode::
 
+    import numpy as np
+    import pyarrow as pa
+
+    arr = pa.array(np.arange(100))
+
     print(f"{arr[0]} .. {arr[-1]}")
 
 .. testoutput::
@@ -372,6 +382,11 @@ Given an array with 100 numbers, from 0 to 99
 
 .. testcode::
 
+    import numpy as np
+    import pyarrow as pa
+
+    arr = pa.array(np.arange(100))
+
     print(f"{arr[0]} .. {arr[-1]}")
 
 .. testoutput::