Construct pyarrow.Schema from collection of fields.
Fields
or tuples
, or mapping of strings
to DataTypes
Can also pass an object that implements the Arrow PyCapsule Protocol for schemas (has an __arrow_c_schema__
method).
dict
, default None
Keys and values must be coercible to bytes.
pyarrow.Schema
Examples
Create a Schema from iterable of tuples:
>>> import pyarrow as pa >>> pa.schema([ ... ('some_int', pa.int32()), ... ('some_string', pa.string()), ... pa.field('some_required_string', pa.string(), nullable=False) ... ]) some_int: int32 some_string: string some_required_string: string not null
Create a Schema from iterable of Fields:
>>> pa.schema([ ... pa.field('some_int', pa.int32()), ... pa.field('some_string', pa.string()) ... ]) some_int: int32 some_string: string
DataTypes can also be passed as strings. The following is equivalent to the above example:
>>> pa.schema([ ... pa.field('some_int', "int32"), ... pa.field('some_string', "string") ... ]) some_int: int32 some_string: string
Or more concisely:
>>> pa.schema([ ... ('some_int', "int32"), ... ('some_string', "string") ... ]) some_int: int32 some_string: string
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