Skip to content

[Python] Add example of how to set a schema field to a specific value #378

@thisisnic

Description

@thisisnic

e.g.


fields = [
    pa.field('foo', pa.int32()),
    pa.field('bar', pa.string()),
    pa.field('baz', pa.list_(pa.int8()))
]
s1 = pa.schema(fields)

s2 = s1.set(0, s1.field(0).with_type(pa.int64()))

See apache/arrow#42012 (comment) for more informaiton

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions