jorisvandenbossche opened a new issue, #49644:
URL: https://github.com/apache/arrow/issues/49644
### Describe the enhancement requested
When you want to construct a fixed shape tensor array, not from a single
contiguous ndarray, but from a list of the individual array elements, this
"accidentally" works for 1d arrays (because we support that for ListArray):
```python
>>> pa.array([np.array([1,2,3]), np.array([2,3,4])],
type=pa.fixed_shape_tensor(pa.int64(), shape=(3,)))
<pyarrow.lib.FixedShapeTensorArray object at 0x7fadc4d1f3a0>
[
[
1,
2,
3
],
[
2,
3,
4
]
]
```
But trying the same for >1 d arrays, you get the following error:
```python
>>> pa.array([np.array([[1,2,3]]), np.array([[2,3,4]])],
type=pa.fixed_shape_tensor(pa.int64(), shape=(1, 3)))
...
ArrowInvalid: Can only convert 1-dimensional array values
```
AFAIK, the only way to currently do this conversion, is to convert the list
of arrays to a single ndarray yourself, and then use
`pa.FixedShapeTensorArray.from_numpy_ndarray`.
(cc @rok)
### Component(s)
Python
--
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]