I have pyarrow table which have column order ['A', 'B', 'C', 'D'] I want to change the order of this pyarrow table to ['B', 'D', 'C', 'A'] can we reorder pyarrows table like pandas dataframe ?
You can use pyarrow.Table.select
import pyarrow as pa
table_a_b = pa.table({
"A": [1,2,3],
"B": [4,5,6]
})
table_b_a = table_a_b.select(['B', 'A'])
| B | A |
|---|---|
| 4 | 1 |
| 5 | 2 |
| 6 | 3 |
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With