Use pyarrow Tensor dtype
See original GitHub issueFeature request
I was going the discussion of converting tensors to lists. Is there a way to leverage pyarrow’s Tensors for nested arrays / embeddings?
For example:
import pyarrow as pa
import numpy as np
x = np.array([[2, 2, 4], [4, 5, 100]], np.int32)
pa.Tensor.from_numpy(x, dim_names=["dim1","dim2"])
Maybe this belongs into the pyarrow features / repo.
Motivation
Working with big data, we need to make sure to use the best data structures and IO out there
Your contribution
Can try to a PR if code changes necessary
Issue Analytics
- State:
- Created 10 months ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
pyarrow.Tensor — Apache Arrow v10.0.1
pyarrow.Tensor¶ ; dim_name (self, i). Returns the name of the i-th tensor dimension. ; equals (self, Tensor other). Return true if the tensors...
Read more >Data Types and In-Memory Data Model - Apache Arrow
The Dictionary type in PyArrow is a special array type that is similar to a factor in R or a pandas.Categorical . It...
Read more >Data Types and Schemas — Apache Arrow v10.0.1
Construct pyarrow.Schema from collection of fields. from_numpy_dtype (dtype). Convert NumPy dtype to pyarrow.DataType.
Read more >pyarrow.DataType — Apache Arrow v10.0.1
pyarrow.DataType¶ ... Base class of all Arrow data types. Each data type is an instance of this class. ... Return true if type...
Read more >Extending pyarrow — Apache Arrow v10.0.1
Using the first approach, we create a UuidType subclass, and implement the __reduce__ method to ensure the class can be properly pickled: ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The work stalled a little because it was not clear where TensorArray would live. However Arrow community recently agreed to make a well-known-extension-type document and I would like https://github.com/apache/arrow/pull/8510 to land there and add an implementation to C++/Python + another language. Is that something you would find beneficial to you?
Hey @franz101 & @lhoestq! There is a plan and a PR to create an ExtensionArray of Tensors of equal sizes as well as a plan to do the same for Tensors of different sizes ARROW-8714.