Create a pyarrow.Field instance.
str
or bytes
Name of the field. Alternatively, you can also pass an object that implements the Arrow PyCapsule Protocol for schemas (has an __arrow_c_schema__
method).
pyarrow.DataType
or str
Arrow datatype of the field or a string matching one.
True
Whether the fieldâs values are nullable.
dict
, default None
Optional field metadata, the keys and values must be coercible to bytes.
pyarrow.Field
Examples
Create an instance of pyarrow.Field:
>>> import pyarrow as pa >>> pa.field('key', pa.int32()) pyarrow.Field<key: int32> >>> pa.field('key', pa.int32(), nullable=False) pyarrow.Field<key: int32 not null>
>>> field = pa.field('key', pa.int32(), ... metadata={"key": "Something important"}) >>> field pyarrow.Field<key: int32> >>> field.metadata {b'key': b'Something important'}
Use the field to create a struct type:
>>> pa.struct([field]) StructType(struct<key: int32>)
A str can also be passed for the type parameter:
>>> pa.field('key', 'int32') pyarrow.Field<key: int32>
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