pyarrow.Tensor

class pyarrow.Tensor

Bases: pyarrow.lib._Weakrefable

A n-dimensional array a.k.a Tensor.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

dim_name(self, i)

equals(self, Tensor other)

Return true if the tensors contains exactly equal data

from_numpy(obj[, dim_names])

Create a Tensor from a numpy array.

to_numpy(self)

Convert arrow::Tensor to numpy.ndarray with zero copy

Attributes

dim_names

is_contiguous

is_mutable

ndim

shape

size

strides

type

dim_name(self, i)
dim_names
equals(self, Tensor other)

Return true if the tensors contains exactly equal data

static from_numpy(obj, dim_names=None)

Create a Tensor from a numpy array.

Parameters
objnumpy.ndarray

The source numpy array

dim_nameslist, optional

Names of each dimension of the Tensor.

is_contiguous
is_mutable
ndim
shape
size
strides
to_numpy(self)

Convert arrow::Tensor to numpy.ndarray with zero copy

type