| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/api/../../cpp/../python/generated/pyarrow.concat_tables.html | [Back] [Original] |
Section Navigation
Concatenate pyarrow.Table objects.
If promote_options=none, a zero-copy concatenation will be performed. The schemas of all the Tables must be the same (except the metadata), otherwise an exception will be raised. The result Table will share the metadata with the first table.
If promote_options=default, any null type arrays will be casted to the type of other
arrays in the column of the same name. If a table is missing a particular
field, null values of the appropriate type will be generated to take the
place of the missing field. The new schema will share the metadata with the
first table. Each field in the new schema will share the metadata with the
first table which has the field defined. Note that type promotions may
involve additional allocations on the given memory_pool.
If promote_options=permissive, the behavior of default plus types will be promoted to the common denominator that fits all the fields.
pyarrow.Table objectsPyarrow tables to concatenate into a single Table.
MemoryPool, default NoneFor memory allocations, if required, otherwise use default pool.
str, default noneAccepts strings none, default and permissive.
dict, optionalExamples
>>> import pyarrow as pa
>>> t1 = pa.table([
... pa.array([2, 4, 5, 100]),
... pa.array(["Flamingo", "Horse", "Brittle stars", "Centipede"])
... ], names=['n_legs', 'animals'])
>>> t2 = pa.table([
... pa.array([2, 4]),
... pa.array(["Parrot", "Dog"])
... ], names=['n_legs', 'animals'])
>>> pa.concat_tables([t1,t2])
pyarrow.Table
n_legs: int64
animals: string
----
n_legs: [[2,4,5,100],[2,4]]
animals: [["Flamingo","Horse","Brittle stars","Centipede"],["Parrot","Dog"]]
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 |