cudf.core.column.string.StringMethods.detokenize#

StringMethods.detokenize(indices: cudf.Series, separator: str = ' ') SeriesOrIndex[source]#

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

Parameters:
indicesSeries

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

separatorstr

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

Returns:
Series or Index of object.

示例

>>> 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