Array Data Types#

The logical types of the elements of an Array. Each logical type is implemented by a variety of Array encodings which describe both a representation-as-bytes as well as how to apply operations on that representation.

DType

A data type describes the set of operations available on a given column.

binary

Construct a data type for binary strings.

bool

Construct a Boolean data type.

float

Construct an IEEE 754 binary floating-point data type.

int

Construct a signed integral data type.

null

Construct the data type for a column containing only the null value.

uint

Construct an unsigned integral data type.

utf8

Construct a UTF-8-encoded string data type.


class vortex.dtype.DType#

A data type describes the set of operations available on a given column. These operations are implemented by the column encoding. Each data type is implemented by one or more encodings.

vortex.dtype.binary(nullable=False)#

Construct a data type for binary strings.

Parameters:

nullable (bool) – When True, None is a permissible value.

Return type:

vortex.dtype.DType

Examples

A data type permitting any string of bytes but not permitting None.

>>> vortex.dtype.binary(False)
binary(False)
vortex.dtype.bool(nullable=False)#

Construct a Boolean data type.

Parameters:

nullable (bool) – When True, None is a permissible value.

Return type:

vortex.dtype.DType

Examples

A data type permitting None, True, and False.

>>> vortex.dtype.bool(True)
bool(True)

A data type permitting just True and False.

>>> vortex.dtype.bool(False)
bool(False)
vortex.dtype.float(width=None, nullable=False)#

Construct an IEEE 754 binary floating-point data type.

Parameters:
  • width (Literal[16, 32, 64].) – The bit width determines the range and precision of the floating-point values. If None, 64 is used.

  • nullable (bool) – When True, None is a permissible value.

Return type:

vortex.dtype.DType

Examples

A data type permitting None as well as IEEE 754 binary16 floating-point values. Values larger than 65,520 or less than -65,520 will respectively round to positive and negative infinity.

>>> vortex.dtype.float(16, False)
float(16, False)
vortex.dtype.int(width=None, nullable=False)#

Construct a signed integral data type.

Parameters:
  • width (Literal[8, 16, 32, 64].) – The bit width determines the span of valid values. If None, 64 is used.

  • nullable (bool) – When True, None is a permissible value.

Return type:

vortex.dtype.DType

Examples

A data type permitting None and the integers from -128 to 127, inclusive:

>>> vortex.dtype.int(8, True)
int(8, True)

A data type permitting just the integers from -2,147,483,648 to 2,147,483,647, inclusive:

>>> vortex.dtype.int(32, False)
int(32, False)
vortex.dtype.null()#

Construct the data type for a column containing only the null value.

Return type:

vortex.dtype.DType

Examples

A data type permitting only None.

>>> vortex.dtype.null()
null()
vortex.dtype.uint(width=None, nullable=False)#

Construct an unsigned integral data type.

Parameters:
  • width (Literal[8, 16, 32, 64].) – The bit width determines the span of valid values. If None, 64 is used.

  • nullable (bool) – When True, None is a permissible value.

Return type:

vortex.dtype.DType

Examples

A data type permitting None and the integers from 0 to 255, inclusive:

>>> vortex.dtype.uint(8, True)
uint(8, True)

A data type permitting just the integers from 0 to 4,294,967,296 inclusive:

>>> vortex.dtype.uint(32, False)
uint(32, False)
vortex.dtype.utf8(nullable=False)#

Construct a UTF-8-encoded string data type.

Parameters:

nullable (bool) – When True, None is a permissible value.

Return type:

vortex.dtype.DType

Examples

A data type permitting any UTF-8-encoded string, such as "Hello World", but not permitting None.

>>> vortex.dtype.utf8(False)
utf8(False)