Stack tables along columns (horizontally)
A join_type of ‘exact’ means that the tables must all have exactly the same number of rows. If join_type is ‘inner’ then the intersection of rows will be output. A value of ‘outer’ (default) means the output will have the union of all rows, with table values being masked where no common values are available.
Parameters: | tables : List of Table objects
join_type : str
uniq_col_name : str or None
table_names : list of str or None
col_name_map : empty dict or None
metadata_conflicts : str
|
---|
Examples
To stack two tables horizontally (along columns) do:
>>> from astropy.table import Table, hstack
>>> t1 = Table({'a': [1, 2], 'b': [3, 4]}, names=('a', 'b'))
>>> t2 = Table({'c': [5, 6], 'd': [7, 8]}, names=('c', 'd'))
>>> print(t1)
a b
--- ---
1 3
2 4
>>> print(t2)
c d
--- ---
5 7
6 8
>>> print(hstack([t1, t2]))
a b c d
--- --- --- ---
1 3 5 7
2 4 6 8