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.
Factory Functions¶
- vortex.null()¶
Construct the data type for a column containing only the null value.
- Return type:
Examples
A data type permitting only
None
.>>> import vortex as vx >>> vx.null() null()
- vortex.bool_(*, nullable=False)¶
Construct a Boolean data type.
- Parameters:
- Return type:
Examples
A data type permitting
None
,True
, andFalse
.>>> import vortex as vx >>> vx.bool_(nullable=True) bool(nullable=True)
A data type permitting just
True
andFalse
.>>> vx.bool_() bool(nullable=False)
- vortex.float_(width=64, *, nullable=False)¶
Construct an IEEE 754 binary floating-point data type.
- Parameters:
- Return type:
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.>>> import vortex as vx >>> vx.float_(16, nullable=False) float(16, nullable=False)
- vortex.int_(width=64, *, nullable=False)¶
Construct a signed integral data type.
- Parameters:
- Return type:
Examples
A data type permitting
None
and the integers from -128 to 127, inclusive:>>> import vortex as vx >>> vx.int_(8, nullable=True) int(8, nullable=True)
A data type permitting just the integers from -2,147,483,648 to 2,147,483,647, inclusive:
>>> vx.int_(32) int(32, nullable=False)
- vortex.uint(width=64, *, nullable=False)¶
Construct an unsigned integral data type.
- Parameters:
- Return type:
Examples
A data type permitting
None
and the integers from 0 to 255, inclusive:>>> import vortex as vx >>> vx.uint(8, nullable=True) uint(8, nullable=True)
A data type permitting just the integers from 0 to 4,294,967,296 inclusive:
>>> vx.uint(32, nullable=False) uint(32, nullable=False)
- vortex.utf8(*, nullable=False)¶
Construct a UTF-8-encoded string data type.
- Parameters:
- Return type:
Examples
A data type permitting any UTF-8-encoded string, such as
"Hello World"
, but not permittingNone
.>>> import vortex as vx >>> vx.utf8(nullable=False) utf8(nullable=False)
- vortex.binary(*, nullable=False)¶
Construct a binary data type.
- Parameters:
- Return type:
Examples
A data type permitting any string of bytes but not permitting
None
.>>> import vortex as vx >>> vx.binary(nullable=False) binary(nullable=False)
- vortex.struct(fields=None, *, nullable=False)¶
Construct a struct data type.
- Parameters:
- Return type:
Examples
A data type permitting a struct with two fields,
"name"
and"age"
, where"name"
is a UTF-8-encoded string and"age"
is a 32-bit signed integer:>>> import vortex as vx >>> vx.struct({"name": vx.utf8(), "age": vx.int_(32)}) struct({"name": utf8(nullable=False), "age": int(32, nullable=False)}, nullable=False)
Base Class¶
Do not instantiate these classes directly. Instead, call one of the factory functions above.
DType Classes¶
- class vortex.NullDType¶
Concrete class for null dtypes.
- class vortex.BoolDType¶
Concrete class for boolean dtypes.
- class vortex.PrimitiveDType¶
Concrete class for primitive dtypes.
- class vortex.Utf8DType¶
Concrete class for utf8 dtypes.
- class vortex.BinaryDType¶
Concrete class for utf8 dtypes.
- class vortex.StructDType¶
Concrete class for struct dtypes.
- fields()¶
Returns the field DTypes of the struct.
- names()¶
Returns the names of the struct fields.
- class vortex.ListDType¶
Concrete class for list dtypes.
- class vortex.ExtensionDType¶
Concrete class for extension dtypes.