pyarrow.HalfFloatScalar#

class pyarrow.HalfFloatScalar#

基类: Scalar

浮点标量的具体类。

__init__(*args, **kwargs)#

方法

__init__(*args, **kwargs)

as_py(self, *[, maps_as_pydicts])

将此值作为 Python 浮点数返回。

cast(self[, target_type, safe, options, ...])

将标量值转换为另一种数据类型。

equals(self, Scalar other)

validate(self, *[, full])

执行验证检查。

属性

is_valid

包含一个有效(非空)值。

type

Scalar 对象的数据类型。

as_py(self, *, maps_as_pydicts=None)#

将此值作为 Python 浮点数返回。

参数:
maps_as_pydictsstr, 可选, 默认 None

有效值为 None、‘lossy’ 或 ‘strict’。此参数对于非嵌套标量将被忽略。

cast(self, target_type=None, safe=None, options=None, memory_pool=None)#

将标量值转换为另一种数据类型。

用法请参见 pyarrow.compute.cast()

参数:
target_typeDataType, 默认 None

要转换成的目标类型。

safebool, 默认 True

是否检查转换错误(如溢出)。

optionsCastOptions, 默认 None

通过 CastOptions 传递的额外检查

memory_poolMemoryPool, 可选

函数执行期间用于分配的内存池。

返回:
scalar给定目标数据类型的 Scalar
equals(self, Scalar other)#
参数:
otherpyarrow.Scalar
返回:
bool
is_valid#

包含一个有效(非空)值。

type#

Scalar 对象的数据类型。

validate(self, *, full=False)#

执行验证检查。如果验证失败,则会引发异常。

默认情况下,仅运行低成本的验证检查。传递 full=True 进行彻底的验证检查(可能为 O(n))。

参数:
fullbool, 默认 False

如果为 True,则运行昂贵的检查,否则仅运行低成本检查。

引发:
ArrowInvalid