Scalars#

A scalar is a single atomic value like the integer 1, the string "hello", or the structure {"age": 55, "name": "Angela"}. The Array.scalar_at() method returns a native Python value when the cost of doing so is small. However, for larger values like binary data, UTF-8 strings, variable-length lists, and structures, Vortex returns a zero-copy view of the Array data. The into_python method of each view will copy the scalar into a native Python value.

Factory Function#

vortex.scalar(value, *, dtype=None)#

Base Class#

class vortex.Scalar#

Base class for Vortex scalar types.

as_py()#

Return the scalar value as a Python object.

dtype#

Return the DType of the scalar.

Scalar Classes#

class vortex.NullScalar#
class vortex.BoolScalar#

Concrete class for boolean scalars.

class vortex.PrimitiveScalar#

Concrete class for primitive scalars.

class vortex.Utf8Scalar#

Concrete class for utf8 scalars.

class vortex.BinaryScalar#

Concrete class for binary scalars.

class vortex.StructScalar#

Concrete class for struct scalars.

field(name)#

Return the child scalar with the given field name.

class vortex.ListScalar#

Concrete class for list scalars.

element(idx)#

Return the child scalar at the given index.

class vortex.ExtensionScalar#

Concrete class for extension scalars.

storage()#

Return the underlying storage scalar.