pyarrow.compute.struct_field#

pyarrow.compute.struct_field(values,/,indices,*,options=None,memory_pool=None)#

Extract children of a struct or union by index.

Given a list of indices (passed via StructFieldOptions), extractthe child array or scalar with the given child index, recursively.

For union inputs, nulls are emitted for union values that referencea different child than specified. Also, the indices are alwaysin physical order, not logical type codes - for example, the firstchild is always index 0.

An empty list of indices returns the argument unchanged.

Parameters:
valuesArray-like or scalar-like

Argument to compute function.

indicesList[str],List[bytes],List[int],Expression,bytes,str, orint

List of indices for chained field lookup, for example[4, 1]will look up the second nested field in the fifth outer field.

optionspyarrow.compute.StructFieldOptions, optional

Alternative way of passing options.

memory_poolpyarrow.MemoryPool, optional

If not passed, will allocate memory from the default memory pool.