pvardanis commented on issue #36890:
URL: https://github.com/apache/arrow/issues/36890#issuecomment-1651855669
Seems I found a solution:
```python
data = [
pa.array([1, 2, 3]),
pa.array(['foo', 'bar', None]),
pa.array([True, None, True]),
tensor_array,
tensor_array_2
]
my_schema = pa.schema([('f0', pa.int8()),
('f1', pa.string()),
('f2', pa.bool_()),
('tensors_int', tensor_type),
('tensors_float', tensor_type_2)])
table = pa.Table.from_arrays(data, schema=my_schema)
tensor_array_restructured = np.array([np.reshape(array,
tuple(table.schema.field('tensors_int').type.shape)) for array in
table['tensors_int'].to_numpy()])
```
--
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]