daft.DataType
daft.DataType#
- class daft.DataType[source]#
A Daft DataType defines the type of all the values in an Expression or DataFrame column
Methods
__init__
()binary
()Create a Binary DataType: A string of bytes
bool
()Create the Boolean DataType: Either
True
orFalse
date
()Create a Date DataType: A date with a year, month and day
decimal128
(precision, scale)Fixed-precision decimal.
duration
(timeunit)Duration DataType.
embedding
(dtype, size)Create an Embedding DataType: embeddings are fixed size arrays, where each element in the array has a numeric
dtype
and each array has a fixed length ofsize
.extension
(name, storage_dtype[, metadata])fixed_size_list
(dtype, size)Create a FixedSizeList DataType: Fixed-size list, where each element in the list has type
dtype
and each list has lengthsize
.float32
()Create a 32-bit float DataType
float64
()Create a 64-bit float DataType
from_arrow_type
(arrow_type)Maps a PyArrow DataType to a Daft DataType
from_numpy_dtype
(np_type)Maps a Numpy datatype to a Daft DataType
image
([mode, height, width])Create an Image DataType: image arrays contain (height, width, channel) ndarrays of pixel values.
int16
()Create an 16-bit integer DataType
int32
()Create an 32-bit integer DataType
int64
()Create an 64-bit integer DataType
int8
()Create an 8-bit integer DataType
list
(dtype)Create a List DataType: Variable-length list, where each element in the list has type
dtype
null
()Creates the Null DataType: Always the
Null
valuepython
()Create a Python DataType: a type which refers to an arbitrary Python object
string
()Create a String DataType: A string of UTF8 characters
struct
(fields)Create a Struct DataType: a nested type which has names mapped to child types
tensor
(dtype[, shape])Create a tensor DataType: tensor arrays contain n-dimensional arrays of data of the provided
dtype
as elements, each of the providedshape
.timestamp
(timeunit[, timezone])Timestamp DataType.
to_arrow_dtype
([cast_tensor_to_ray_type])uint16
()Create an unsigned 16-bit integer DataType
uint32
()Create an unsigned 32-bit integer DataType
uint64
()Create an unsigned 64-bit integer DataType
uint8
()Create an unsigned 8-bit integer DataType