DataTypes
Contents
DataTypes#
A Daft DataType defines the type of all the values in an Expression or DataFrame column |
DataType Constructors#
Construct Daft DataTypes using these constructor APIs.
This is useful in many situations, such as casting, schema declaration and more.
import daft
dtype = daft.DataType.int64()
df = df.with_column("int64_column", df["int8_col"].cast(dtype))
Numeric#
Create an 8-bit integer DataType |
|
Create an 16-bit integer DataType |
|
Create an 32-bit integer DataType |
|
Create an 64-bit integer DataType |
|
Create an unsigned 8-bit integer DataType |
|
Create an unsigned 16-bit integer DataType |
|
Create an unsigned 32-bit integer DataType |
|
Create an unsigned 64-bit integer DataType |
|
Create a 32-bit float DataType |
|
Create a 64-bit float DataType |
Logical#
Create the Boolean DataType: Either |
Strings#
Create a Binary DataType: A string of bytes |
|
Create a String DataType: A string of UTF8 characters |
Temporal#
Create a Date DataType: A date with a year, month and day |
Nested#
Create a List DataType: Variable-length list, where each element in the list has type |
|
Create a FixedSizeList DataType: Fixed-size list, where each element in the list has type |
|
Create a Struct DataType: a nested type which has names mapped to child types |
Python#
Create a Python DataType: a type which refers to an arbitrary Python object |
Complex Types#
Machine Learning#
Create a tensor DataType: tensor arrays contain n-dimensional arrays of data of the provided |
|
Create an Embedding DataType: embeddings are fixed size arrays, where each element in the array has a numeric |
Computer Vision#
Create an Image DataType: image arrays contain (height, width, channel) ndarrays of pixel values. |
Supported image modes for Daft's image type. |
Supported image formats for Daft's I/O layer. |
Miscellaneous#
Creates the Null DataType: Always the |