當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python cudf.Series.set_index用法及代碼示例

用法:

Series.set_index(index)

返回具有不同索引的新係列。

參數

index索引,Series-convertible

新索引或新索引的值

返回

Series

具有指定索引的新係列。

例子

>>> import cudf
>>> series = cudf.Series([10, 11, 12, 13, 14])
>>> series
0    10
1    11
2    12
3    13
4    14
dtype: int64
>>> series.set_index(['a', 'b', 'c', 'd', 'e'])
a    10
b    11
c    12
d    13
e    14
dtype: int64

相關用法


注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cudf.Series.set_index。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。