| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/generated/pyarrow.schema.html | [Back] [Original] |
Section Navigation
Construct pyarrow.Schema from collection of fields.
pyarrow.SchemaExamples
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
Copyright 2016-2026 Apache Software Foundation.
Apache Arrow, Arrow, Apache, the Apache logo, and the Apache Arrow project logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.
Created using Sphinx 9.1.0.
Built with the PyData Sphinx Theme 0.20.0.
| Web Proxy Viewer | New URL | Original Page |