You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "wjones127 (via GitHub)" <gi...@apache.org> on 2023/08/31 01:55:05 UTC
[GitHub] [arrow] wjones127 opened a new issue, #37484: [Python] Add a FixedSizeTensorScalar class
wjones127 opened a new issue, #37484:
URL: https://github.com/apache/arrow/issues/37484
### Describe the enhancement requested
When you get a scalar off of a `FixedSizeTensorArray`, you get back a generic `ExtensionTensor`. There's not an easy way to get the tensor contained back as a numpy ndarray. It would be nice to have:
```python
def FixedSizeTensorScalar(pa.ExtensionScalar):
def to_numpy_ndarray(): ...
```
Then one could do:
```python
tensor_array[i].to_numpy_ndarray()
```
As a workaround, I currently do:
```python
tensor_array.to_numpy_ndarray()[i]
```
Which isn't too bad.
### 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: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Add a FixedSizeTensorScalar class [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou closed issue #37484: [Python] Add a FixedSizeTensorScalar class
URL: https://github.com/apache/arrow/issues/37484
--
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: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] wjones127 commented on issue #37484: [Python] Add a FixedSizeTensorScalar class
Posted by "wjones127 (via GitHub)" <gi...@apache.org>.
wjones127 commented on issue #37484:
URL: https://github.com/apache/arrow/issues/37484#issuecomment-1701535505
> Also, another workaround would be:
> tensor_array.slice(i, i+1).to_numpy_ndarray()[0]
Yes, but that doesn't work in 12.0.0. There is a bug that was fixed in 13.0.0 where `to_numpy_ndarray()` didn't work properly on sliced tensors.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] rok commented on issue #37484: [Python] Add a FixedSizeTensorScalar class
Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on issue #37484:
URL: https://github.com/apache/arrow/issues/37484#issuecomment-1701554163
Oh yeah, that's right.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] jorisvandenbossche commented on issue #37484: [Python] Add a FixedSizeTensorScalar class
Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on issue #37484:
URL: https://github.com/apache/arrow/issues/37484#issuecomment-1700410277
Sounds good!
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] rok commented on issue #37484: [Python] Add a FixedSizeTensorScalar class
Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on issue #37484:
URL: https://github.com/apache/arrow/issues/37484#issuecomment-1700774456
I can grab this one.
Also, another workaround would be:
```
tensor_array.slice(i, i+1).to_numpy_ndarray()[0]
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org