Create StructType instance from fields.
A struct is a nested type parameterized by an ordered sequence of types (which can all be distinct), called its fields.
Fields
or tuples
, or mapping of strings
to DataTypes
Each field must have a UTF8-encoded name, and these field names are part of the type metadata.
DataType
Examples
Create an instance of StructType from an iterable of tuples:
>>> import pyarrow as pa >>> fields = [ ... ('f1', pa.int32()), ... ('f2', pa.string()), ... ] >>> struct_type = pa.struct(fields) >>> struct_type StructType(struct<f1: int32, f2: string>)
Retrieve a field from a StructType:
>>> struct_type[0] pyarrow.Field<f1: int32> >>> struct_type['f1'] pyarrow.Field<f1: int32>
Create an instance of StructType from an iterable of Fields:
>>> fields = [ ... pa.field('f1', pa.int32()), ... pa.field('f2', pa.string(), nullable=False), ... ] >>> pa.struct(fields) StructType(struct<f1: int32, f2: string not null>)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4