Back to Polars

Data types

docs/user-guide/concepts/data-types.md

latest4.3 KB
Original Source

Data types

Polars is entirely based on Arrow data types and backed by Arrow memory arrays. This makes data processing cache-efficient and well-supported for Inter Process Communication. Most data types follow the exact implementation from Arrow, with the exception of Utf8 (this is actually LargeUtf8), Categorical, and Object (support is limited). The data types are:

GroupTypeDetails
NumericInt88-bit signed integer.
Int1616-bit signed integer.
Int3232-bit signed integer.
Int6464-bit signed integer.
UInt88-bit unsigned integer.
UInt1616-bit unsigned integer.
UInt3232-bit unsigned integer.
UInt6464-bit unsigned integer.
Float3232-bit floating point.
Float6464-bit floating point.
NestedStructA struct array is represented as a Vec<Series> and is useful to pack multiple/heterogenous values in a single column.
ListA list array contains a child array containing the list values and an offset array. (this is actually Arrow LargeList internally).
TemporalDateDate representation, internally represented as days since UNIX epoch encoded by a 32-bit signed integer.
DatetimeDatetime representation, internally represented as microseconds since UNIX epoch encoded by a 64-bit signed integer.
DurationA timedelta type, internally represented as microseconds. Created when subtracting Date/Datetime.
TimeTime representation, internally represented as nanoseconds since midnight.
OtherBooleanBoolean type effectively bit packed.
Utf8String data (this is actually Arrow LargeUtf8 internally).
BinaryStore data as bytes.
ObjectA limited supported data type that can be any value.
CategoricalA categorical encoding of a set of strings.

To learn more about the internal representation of these data types, check the Arrow columnar format.