Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-2147

[Python] Type inference doesn't work on lists of Numpy arrays

    Details

      Description

      >>> arr = np.int16([2, 3, 4])
      >>> pa.array(arr)
      <pyarrow.lib.Int16Array object at 0x7f939f30a0e8>
      [
        2,
        3,
        4
      ]
      >>> pa.array([arr])
      Traceback (most recent call last):
        File "<ipython-input-6-254285212203>", line 1, in <module>
          pa.array([arr])
        File "array.pxi", line 181, in pyarrow.lib.array
        File "array.pxi", line 26, in pyarrow.lib._sequence_to_array
        File "error.pxi", line 77, in pyarrow.lib.check_status
      ArrowInvalid: /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:964 code: InferArrowType(seq, &real_type)
      /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:321 code: seq_visitor.Visit(obj)
      /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:195 code: VisitElem(ref, level)
      Error inferring Arrow data type for collection of Python objects. Got Python object of type ndarray but can only handle these types: bool, float, integer, date, datetime, bytes, unicode
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                xhochy Uwe L. Korn
                Reporter:
                pitrou Antoine Pitrou
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: