pyarrow.RunEndEncodedScalar#
- class pyarrow.RunEndEncodedScalar#
基类:
ScalarRunEndEncoded 标量的具体类。
- __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])执行验证检查。
属性
- as_py(self, *, maps_as_pydicts=None)#
将底层值作为 Python 对象返回。
- 参数:
- maps_as_pydicts
str, 可选, 默认 None 有效值为 None、‘lossy’ 或 ‘strict’。默认行为 (None) 是将 Arrow Map 数组转换为与 Arrow Map 顺序相同的原生 Python 关联列表(元组列表),如 [(key1, value1), (key2, value2), …]。
如果为 ‘lossy’ 或 ‘strict’,则将 Arrow Map 数组转换为原生 Python 字典。
如果为 ‘lossy’,则每当检测到重复键时,都会打印警告。重复键的最后看到的值将出现在 Python 字典中。如果为 ‘strict’,则会在检测到时引发异常。
- maps_as_pydicts
- cast(self, target_type=None, safe=None, options=None, memory_pool=None)#
将标量值转换为另一种数据类型。
用法请参见
pyarrow.compute.cast()。
- equals(self, Scalar other)#
- 参数:
- other
pyarrow.Scalar
- other
- 返回:
- is_valid#
包含一个有效(非空)值。
- type#
Scalar 对象的数据类型。
- validate(self, *, full=False)#
执行验证检查。如果验证失败,则会引发异常。
默认情况下,仅运行低成本的验证检查。传递 full=True 进行彻底的验证检查(可能为 O(n))。
- value#
将底层值作为标量返回。