| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/generated/../api/../generated/pyarrow.concat_batches.html | [Back] [Original] |
Section Navigation
Concatenate pyarrow.RecordBatch objects.
All recordbatches must share the same Schema, the operation implies a copy of the data to merge the arrays of the different RecordBatches.
pyarrow.RecordBatch objectsPyarrow record batches to concatenate into a single RecordBatch.
MemoryPool, default NoneFor memory allocations, if required, otherwise use default pool.
Examples
>>> import pyarrow as pa
>>> t1 = pa.record_batch([
... pa.array([2, 4, 5, 100]),
... pa.array(["Flamingo", "Horse", "Brittle stars", "Centipede"])
... ], names=['n_legs', 'animals'])
>>> t2 = pa.record_batch([
... pa.array([2, 4]),
... pa.array(["Parrot", "Dog"])
... ], names=['n_legs', 'animals'])
>>> pa.concat_batches([t1,t2])
pyarrow.RecordBatch
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 |