转换#

pylibcudf.transform.bools_to_mask(Column input) tuple#

从布尔元素列创建位掩码

参数:
inputColumn

用于生成新掩码的列。

返回:
tuple[gpumemoryview, int]

包含位掩码的 gpumemoryview 和空值计数的二元组。

pylibcudf.transform.compute_column(Table input, Expression expr) Column#

通过对表评估表达式来创建列。

有关详细信息,请参阅 compute_column()

参数:
inputTable

用于表达式评估的表

exprExpression

要评估的表达式

返回:
评估表达式生成的列
pylibcudf.transform.encode(Table input) tuple#

将给定表的行编码为整数。

参数:
inputTable

包含要编码值的表

返回:
tuple[Table, Column]

输入表中按排序顺序排列的不同行,以及表示编码行的整数索引列。

pylibcudf.transform.mask_to_bools(Py_ssize_t bitmask, int begin_bit, int end_bit) Column#

从给定位掩码创建布尔列。

参数:
bitmaskint

需要转换的位掩码指针

begin_bitint

应开始转换的位位置

end_bitint

应停止转换的位位置(不包含此位)

返回:
Column

从 [begin_bit, end_bit] 范围内的位掩码生成的布尔列

pylibcudf.transform.nans_to_nulls(Column input) tuple#

创建一个空值掩码,保留现有空值并将 NaN 转换为 null。

有关详细信息,请参阅 nans_to_nulls()

参数:
inputColumn

用于生成新掩码的列。

返回:
包含空值掩码的 gpumemoryview 和新空值计数的二元组。
pylibcudf.transform.one_hot_encode(Column input, Column categories) Table#

通过为 categories 中的每个值生成一个新列来编码 input,新列指示该值是否在 input 中出现。

参数:
inputColumn

包含要编码值的列。

categoriesColumn

包含类别的列

返回:
Column

编码值组成的表。

pylibcudf.transform.transform(list inputs, unicode transform_udf, DataType output_type, bool is_ptx) Column#
通过对

多个输入列应用转换函数来创建新列。

参数:
inputslist[Column]

要转换的列。

transform_udfstr

要应用的转换函数的 PTX/CUDA 字符串。

output_typeDataType

与 unary_udf 中的输出类型兼容的输出类型。

is_ptxbool

如果为 True,则 UDF 被视为 PTX 代码。如果为 False,则 UDF 被视为 CUDA 代码。

返回:
Column

已对每个元素应用 UDF 的转换后的列。