mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 16:47:19 +08:00
### Rationale for this change Enable multidimensional DLPack support for Array via `to_tensor`. ### What changes are included in this PR? - Add virtual `Array::ToTensor` - Add `NumericArray::ToTensor` for 1D arrays - Add `FixedSizeListArray::ToTensor` for multidimensional arrays - Add DLPack error suggestiong tensor convertion - Add DLPack tests with `arr.to_tensor().__dlpack__()` Note: Nulls are explicitly supported in `to_tensor` as unspecified data. This was the current behaviour. ### Are these changes tested? Yes ### Are there any user-facing changes? New public Array function. * GitHub Issue: #38868 Authored-by: AntoinePrv <AntoinePrv@users.noreply.github.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
Python library for Apache Arrow
This library provides a Python API for functionality provided by the Arrow C++ libraries, along with tools for Arrow integration and interoperability with pandas, NumPy, and other software in the Python ecosystem.
Installing
Across platforms, you can install a recent version of pyarrow with the conda package manager:
conda install pyarrow -c conda-forge
On Linux, macOS, and Windows, you can also install binary wheels from PyPI with pip:
pip install pyarrow
If you encounter any issues importing the pip wheels on Windows, you may need to install the latest Visual C++ Redistributable for Visual Studio.
Development
See Python Development in the documentation subproject.
Building the documentation
See documentation build instructions in the documentation subproject.