jorisvandenbossche commented on issue #49644:
URL: https://github.com/apache/arrow/issues/49644#issuecomment-4175799783

   And probably worth a separate issue, but also for the conversion the other 
way around to python, it would be nice to preserve the shape of the ndarrays:
   
   ```python
   >>> arr = 
pa.FixedShapeTensorArray.from_numpy_ndarray(np.stack([np.array([[1,2,3], 
[3,4,5]]), np.array([[2,3,4], [5,6,7]])], axis=1))
   # results in an array of 1D arrays
   >>> arr.to_numpy(zero_copy_only=False)
   array([array([1, 2, 3, 2, 3, 4]), array([3, 4, 5, 5, 6, 7])], dtype=object)
   # the scalars do have a method to convert to the correct shape
   >>> [v.to_numpy() for v in arr]
   [array([[1, 2, 3],
           [2, 3, 4]]),
    array([[3, 4, 5],
           [5, 6, 7]])]
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to