当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


Python cudf.core.column.string.StringMethods.detokenize用法及代码示例

用法:

StringMethods.detokenize(indices: cudf.Series, separator: str = ' ') → SeriesOrIndex

通过按照它们在indices 列中出现的顺序将它们连接起来,将它们组合成字符串。 separator 在每个标记之间连接。

参数

indicesSeries

每个值标识相应标记的输出行。

separatorstr

输出行中每个标记之间连接的字符串。默认为空格。

返回

对象的系列或索引。

例子

>>> import cudf
>>> strs = cudf.Series(["hello", "world", "one", "two", "three"])
>>> indices = cudf.Series([0, 0, 1, 1, 2])
>>> strs.str.detokenize(indices)
0    hello world
1        one two
2          three
dtype: object

相关用法


注:本文由纯净天空筛选整理自rapids.ai大神的英文原创作品 cudf.core.column.string.StringMethods.detokenize。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。