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

[Python] Conversion from Numpy struct array unimplemented

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.9.0
    • Component/s: Python

      Description

      >>> arr = np.array([(1.5,)], dtype=np.dtype([('x', np.float32)]))
      >>> arr
      array([(1.5,)], dtype=[('x', '<f4')])
      >>> arr[0]
      (1.5,)
      >>> arr['x']
      array([1.5], dtype=float32)
      >>> arr['x'][0]
      1.5
      >>> pa.array(arr, type=pa.struct([pa.field('x', pa.float32())]))
      Traceback (most recent call last):
        File "<ipython-input-18-27a52820b7d8>", line 1, in <module>
          pa.array(arr, type=pa.struct([pa.field('x', pa.float32())]))
        File "array.pxi", line 177, in pyarrow.lib.array
        File "error.pxi", line 77, in pyarrow.lib.check_status
        File "error.pxi", line 85, in pyarrow.lib.check_status
      ArrowNotImplementedError: /home/antoine/arrow/cpp/src/arrow/python/numpy_to_arrow.cc:1585 code: converter.Convert()
      NumPyConverter doesn't implement <struct<x: float>> conversion.
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pitrou Antoine Pitrou
                Reporter:
                pitrou Antoine Pitrou
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: