Data Types and Schemas — Apache Arrow v20.0.0 (original) (raw)

These should be used to create Arrow data types and schemas.

null() Create instance of null type.
bool_() Create instance of boolean type.
int8() Create instance of signed int8 type.
int16() Create instance of signed int16 type.
int32() Create instance of signed int32 type.
int64() Create instance of signed int64 type.
uint8() Create instance of unsigned int8 type.
uint16() Create instance of unsigned uint16 type.
uint32() Create instance of unsigned uint32 type.
uint64() Create instance of unsigned uint64 type.
float16() Create half-precision floating point type.
float32() Create single-precision floating point type.
float64() Create double-precision floating point type.
time32(unit) Create instance of 32-bit time (time of day) type with unit resolution.
time64(unit) Create instance of 64-bit time (time of day) type with unit resolution.
timestamp(unit[, tz]) Create instance of timestamp type with resolution and optional time zone.
date32() Create instance of 32-bit date (days since UNIX epoch 1970-01-01).
date64() Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01).
duration(unit) Create instance of a duration type with unit resolution.
month_day_nano_interval() Create instance of an interval type representing months, days and nanoseconds between two dates.
binary(int length=-1) Create variable-length or fixed size binary type.
string() Create UTF8 variable-length string type.
utf8() Alias for string().
large_binary() Create large variable-length binary type.
large_string() Create large UTF8 variable-length string type.
large_utf8() Alias for large_string().
binary_view() Create a variable-length binary view type.
string_view() Create UTF8 variable-length string view type.
decimal128(int precision, int scale=0) Create decimal type with precision and scale and 128-bit width.
decimal256(int precision, int scale=0) Create decimal type with precision and scale and 256-bit width.
list_(value_type, int list_size=-1) Create ListType instance from child data type or field.
large_list(value_type) Create LargeListType instance from child data type or field.
list_view(value_type) Create ListViewType instance from child data type or field.
large_list_view(value_type) Create LargeListViewType instance from child data type or field.
map_(key_type, item_type[, keys_sorted]) Create MapType instance from key and item data types or fields.
struct(fields) Create StructType instance from fields.
dictionary(index_type, value_type, ...) Dictionary (categorical, or simply encoded) type.
run_end_encoded(run_end_type, value_type) Create RunEndEncodedType from run-end and value types.
fixed_shape_tensor(DataType value_type, shape) Create instance of fixed shape tensor extension type with shape and optional names of tensor dimensions and indices of the desired logical ordering of dimensions.
union(child_fields, mode[, type_codes]) Create UnionType from child fields.
dense_union(child_fields[, type_codes]) Create DenseUnionType from child fields.
sparse_union(child_fields[, type_codes]) Create SparseUnionType from child fields.
opaque(DataType storage_type, ...) Create instance of opaque extension type.
bool8() Create instance of bool8 extension type.
uuid() Create UuidType instance.
json_(DataType storage_type=utf8) Create instance of JSON extension type.
field(name[, type, nullable, metadata]) Create a pyarrow.Field instance.
schema(fields[, metadata]) Construct pyarrow.Schema from collection of fields.
from_numpy_dtype(dtype) Convert NumPy dtype to pyarrow.DataType.