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

[Python] Create pyarrow array using an object's `__array__` method.

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 6.0.1
    • None
    • Python
    • None

    Description

      `pa.array` supports optimized creation from an object with the `_arrow_array` method, or from a literal NumPy ndarray. But there's a performance gap if the input object has only an `array_` method, as it isn't used.
       
      So the user has to know to call `np.asarray` first. And even if the original object could be extended to support '_arrow_array_`, it doesn't seems like a great workaround if all that method would do is call `pa.array(np.asarray(self))`.

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              coady A. Coady
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: