cudf.core.column.struct.StructMethods.field#

StructMethods.field(key)#

Extract children of the specified struct column in the Series

Parameters
key: int or str

index/position or field name of the respective struct column

Returns
Series

Examples

>>> s = cudf.Series([{'a': 1, 'b': 2}, {'a': 3, 'b': 4}])
>>> s.struct.field(0)
0    1
1    3
dtype: int64
>>> s.struct.field('a')
0    1
1    3
dtype: int64