polars.datatypes.Float16#

class polars.datatypes.Float16[source]#

16-bit floating point type.

Warning

This functionality is considered unstable. It may be changed at any point without it being considered a breaking change.

Warning

Regular computing platforms do not natively support Float16 operations, and compute operations on Float16 will be significantly slower as a result than operation on Float32 or Float64. As such, it is recommended to cast to Float32 before doing any compute operations, and cast back to Float16 afterward if needed.

__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

base_type()

Return this DataType's fundamental/root type class.

from_python(py_type)

Return the Polars data type corresponding to a given Python type.

is_(other)

Check if this DataType is the same as another DataType.

is_decimal()

Check whether the data type is a decimal type.

is_float()

Check whether the data type is a floating point type.

is_integer()

Check whether the data type is an integer type.

is_nested()

Check whether the data type is a nested type.

is_numeric()

Check whether the data type is a numeric type.

is_object()

Check whether the data type is an object type.

is_signed_integer()

Check whether the data type is a signed integer type.

is_temporal()

Check whether the data type is a temporal type.

is_unsigned_integer()

Check whether the data type is an unsigned integer type.

max()

Return a literal expression representing the maximum value of this data type.

min()

Return a literal expression representing the minimum value of this data type.

to_dtype_expr()

Return a DataTypeExpr with a static DataType.

to_python()

Return the Python type corresponding to this Polars data type.