Data types

Author

Marie-Hélène Burle

Data types supported by Polars are, for the most part, quite classic.

List of data types

numeric numeric temporal temporal sint signed integer numeric--sint uint unsigned integer numeric--uint float float numeric--float Decimal Decimal numeric--Decimal nested nested Date Date temporal--Date Time Time temporal--Time Datetime Datetime temporal--Datetime Duration Duration temporal--Duration List List nested--List Struct Struct nested--Struct Array Array nested--Array Int8 Int8 sint--Int8 Int16 Int16 sint--Int16 Int32 Int32 sint--Int32 Int64 Int64 sint--Int64 UInt8 UInt8 uint--UInt8 UInt16 UInt16 uint--UInt16 UInt32 UInt32 uint--UInt32 UInt64 UInt64 uint--UInt64 Float32 Float32 float--Float32 Float64 Float64 float--Float64 Boolean Boolean Boolean--Int8 Decimal--Date Date--Time Time--Datetime Datetime--Duration String String Duration--String List--Struct Struct--Array Binary Binary String--Binary Object Object Binary--Object Categorical Categorical Object--Categorical Enum Enum Categorical--Enum Enum--List Null Null Null--Boolean Int8--Int16 Int16--Int32 Int32--Int64 Int64--UInt8 UInt8--UInt16 UInt16--UInt32 UInt32--UInt64 UInt64--Float32 Float32--Float64 Float64--Decimal

Exotic Polars types

Structs are series combining multiple columns.

Enum is used for categorical variables. It is stricter, but also more efficient than the more flexible and slower Categorical type. When categories are all known before runtime, use Enum. If you need to infer the categories at runtime, use Categorical.

Object allows to wrap any Python object.